Introduction
Bootstrap is a mobile-first CSS framework originally created at Twitter for building responsive, consistent web interfaces. It provides a comprehensive set of prebuilt components, a flexible grid system, and utility classes that let developers prototype and ship production UIs without writing custom CSS from scratch.
What Bootstrap Does
- Provides a 12-column responsive grid system with breakpoints for mobile, tablet, and desktop layouts
- Includes 30+ prebuilt UI components such as modals, navbars, cards, carousels, and accordions
- Ships JavaScript plugins for interactive behaviors like tooltips, popovers, and dropdowns
- Offers a utility-first class API for spacing, colors, typography, and display properties
- Supports theming through Sass variables and CSS custom properties for full visual customization
Architecture Overview
Bootstrap is built on Sass and compiles to plain CSS. The framework is modular: each component (grid, buttons, forms, etc.) lives in its own Sass partial, so teams can import only what they need. JavaScript plugins are written as ES modules with no jQuery dependency since v5, using a lightweight data-attribute API for initialization. The grid uses CSS Flexbox by default with an optional CSS Grid mode.
Self-Hosting & Configuration
- Install via npm, yarn, or download the compiled CSS/JS bundle from the official site
- Import individual Sass partials to reduce bundle size:
@import "bootstrap/scss/buttons"; - Override default theme variables in a custom
_variables.scssbefore importing Bootstrap - Use PurgeCSS or similar tools in production to strip unused utility classes
- Deploy compiled assets through any CDN or bundle with Webpack, Vite, or Parcel
Key Features
- Mobile-first responsive design that adapts to any screen size out of the box
- Extensive documentation with copy-paste examples for every component
- RTL (right-to-left) support built into the core for internationalized applications
- Accessible by default with ARIA attributes and keyboard navigation on interactive components
- Large ecosystem of third-party themes, templates, and integrations for React, Vue, and Angular
Comparison with Similar Tools
- Tailwind CSS — utility-only approach with no prebuilt components; more flexible but requires more markup
- Bulma — pure CSS with no JavaScript; lighter but lacks interactive components
- Foundation — comparable feature set with a steeper learning curve and smaller community
- Material UI — React-specific with Material Design aesthetic; heavier and framework-locked
- DaisyUI — Tailwind plugin that adds component classes; newer with a smaller ecosystem
FAQ
Q: Does Bootstrap 5 still require jQuery? A: No. Bootstrap 5 dropped the jQuery dependency entirely. All JavaScript plugins are written in vanilla ES modules.
Q: How do I reduce Bootstrap's CSS bundle size? A: Import only the Sass partials you need, or use PurgeCSS to remove unused classes from the compiled output.
Q: Can I use Bootstrap with React or Vue? A: Yes. Libraries like React Bootstrap and BootstrapVue provide wrapper components, or you can use Bootstrap's CSS classes directly.
Q: Is Bootstrap accessible? A: Bootstrap includes ARIA roles, labels, and keyboard support on interactive components. You should still test with screen readers for custom implementations.