Skip to content

Guide · Open source

How to use Bootstrap: install, include files and build responsive pages

Updated · written with AI from the project's own documentation and checked against our catalogue data

Bootstrap is a free, MIT-licensed front-end framework of HTML, CSS and JavaScript that gives web pages a consistent layout and look that adapts to different screen sizes. This guide is for developers who want to build interfaces faster without writing every style and interactive component from scratch. After reading it you will know how to get Bootstrap files into a project, what the download contains, and where to find the documentation.

Bootstraptwbs/bootstrap · ★ 175k · MIT

Quick start

  1. 1Choose an install method. Pick npm, yarn, Bun, Composer, NuGet, a zip download or git clone, based on your project setup.
  2. 2Install the package. Run the install command for your package manager, using the version you intend to use.
  3. 3Include the CSS. Link the bootstrap CSS file from your installed package or the download's css folder in your HTML.
  4. 4Include the JavaScript. Add a bootstrap JS file from the js folder, choosing the bundle if you need Floating UI and Vanilla Calendar Pro.
  5. 5Set text direction if needed. Add dir="rtl" to the html element for right-to-left layouts.
  6. 6Read the docs. Use the getting started page and component docs at getbootstrap.com to build your pages.

What Bootstrap is and who it is for

Bootstrap is a front-end framework, meaning it supplies code that runs in the browser: styles for layout and typography, plus JavaScript for interactive components. Its goal is to make responsive, mobile-first pages quicker to build.

It suits developers building responsive websites or web app interfaces, and teams that want a shared design system with ready-made components. It is not a no-code website builder, because you still edit HTML and CSS.

Install Bootstrap with npm, yarn, Bun or a download

The README lists several quick start options. The package-manager route is the most direct. The README's examples use a pre-release version, so replace it with the version you intend to use.

You can also download the release as a zip, or clone the repository. The README lists no prerequisites for installing.

  • npm: npm install bootstrap@6.0.0-alpha.1
  • yarn: yarn add bootstrap@6.0.0-alpha.1
  • Bun: bun add bootstrap@6.0.0-alpha.1
  • Composer: composer require twbs/bootstrap:6.0.0-alpha.1
  • NuGet: Install-Package bootstrap (CSS) or Install-Package bootstrap.sass (Sass)
  • Clone: git clone https://github.com/twbs/bootstrap.git
npm install bootstrap@6.0.0-alpha.1

Know what is in the Bootstrap download

The download groups common assets and provides both compiled and minified variations. CSS files are in a css folder and JavaScript files are in a js folder.

Files named bootstrap.* are compiled, and bootstrap.min.* are compiled and minified. Source maps (bootstrap.*.map) work with certain browsers' developer tools. The bundle files (bootstrap.bundle.js and bootstrap.bundle.min.js) include Floating UI and Vanilla Calendar Pro.

  • css/bootstrap.css and css/bootstrap.min.css: the full CSS framework
  • css/bootstrap-grid.css, bootstrap-reboot.css and bootstrap-utilities.css: separate parts
  • js/bootstrap.js and js/bootstrap.bundle.js: JavaScript builds

Build responsive layouts for LTR and RTL

All CSS files work for both left-to-right and right-to-left layouts because they use logical properties. To switch to RTL, set dir="rtl" on your HTML element.

Choose a version that matches your project. The default branch is for Bootstrap 6 development, and the README directs Bootstrap 5 users to the v5-dev branch for its readme, documentation and source.

<html dir="rtl">

Find documentation, examples and help

Official documentation is at https://getbootstrap.com/ and is built with Astro. Search on the docs is powered by Pagefind. The README also says the docs can run locally, and points to the getting started page for framework contents, templates and examples.

For bugs and feature requests, read the issue guidelines and search existing issues first. Community questions can go to GitHub Discussions, the community Discord or the Bootstrap subreddit.

What people use it for

  • Building a responsive marketing site that works on phones and desktops
  • Creating an admin or web app interface with ready-made components
  • Developing a site in a right-to-left language by setting dir="rtl"
  • Sharing one design system across several internal web projects

Frequently asked questions

Is Bootstrap free to use?

Yes. The repository is licensed under the MIT License, as shown in the project summary. Check the license file in the repository for the full terms.

What do I need to install Bootstrap?

The source lists no prerequisites for installing. You can install via npm, yarn, Bun, Composer, NuGet, a download or git clone.

How do I install Bootstrap with npm?

Run npm install bootstrap followed by the version you want. The README example uses a pre-release version, bootstrap@6.0.0-alpha.1.

Which version should I use, Bootstrap 5 or 6?

The default branch is for Bootstrap 6 development and the README notes it is an alpha pre-release. Bootstrap 5 users are directed to the v5-dev branch for its docs and source.

Does Bootstrap support right-to-left languages?

Yes. The README says all CSS files work for LTR and RTL layouts thanks to logical properties, and you set dir="rtl" on your HTML element.

How does Bootstrap compare to Tailwind CSS?

Bootstrap provides a recognizable default look and ready-made components. Tailwind CSS, Bulma, Foundation and Materialize are comparable projects that differ in style and approach, so compare them against your project needs.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Bootstrap suits developers who want responsive pages and ready-made components quickly, under a free MIT license. Pick something else if you need a highly custom visual identity, a no-code builder, or you need a stable release rather than the Bootstrap 6 alpha.

Install options & downloads