📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials Bootstrap 5 Bootstrap CDN vs npm

Bootstrap CDN vs npm

4 min read
CDN for quick start; npm install for Sass customization and tree-shaking unused components.

CDN vs npm

<!-- CDN -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>

<!-- npm -->
npm install bootstrap
import "bootstrap/dist/css/bootstrap.min.css";
import * as bootstrap from "bootstrap";

<!-- Import specific components only -->
import Modal from "bootstrap/js/dist/modal";
import Toast from "bootstrap/js/dist/toast";