File: README.md
Bootstrap
Bootstrap 5
Our default branch is for development of our Bootstrap 5 release. Head to the v4-dev branch to view the readme, documentation, and source code for Bootstrap 4.
Table of contents
- Quick start
- Status
- Whatβs included
- Bugs and feature requests
- Documentation
- Contributing
- Community
- Versioning
- Creators
- Thanks
- Copyright and license
Quick start
Several quick start options are available:
- Download the latest release
- Clone the repo:
git clone https://github.com/twbs/bootstrap.git - Install with npm:
npm install [email protected] - Install with yarn:
yarn add [email protected] - Install with Bun:
bun add [email protected] - Install with Composer:
composer require twbs/bootstrap:5.3.8 - Install with NuGet: CSS:
Install-Package bootstrapSass:Install-Package bootstrap.sass
Read the Getting started page for information on the framework contents, templates, examples, and more.
Status
Whatβs included
Within the download youβll find the following directories and files, logically grouping common assets and providing both compiled and minified variations.
Download contents
bootstrap/
βββ css/
β βββ bootstrap-grid.css
β βββ bootstrap-grid.css.map
β βββ bootstrap-grid.min.css
β βββ bootstrap-grid.min.css.map
β βββ bootstrap-grid.rtl.css
β βββ bootstrap-grid.rtl.css.map
β βββ bootstrap-grid.rtl.min.css
β βββ bootstrap-grid.rtl.min.css.map
β βββ bootstrap-reboot.css
β βββ bootstrap-reboot.css.map
β βββ bootstrap-reboot.min.css
β βββ bootstrap-reboot.min.css.map
β βββ bootstrap-reboot.rtl.css
β βββ bootstrap-reboot.rtl.css.map
β βββ bootstrap-reboot.rtl.min.css
β βββ bootstrap-reboot.rtl.min.css.map
β βββ bootstrap-utilities.css
β βββ bootstrap-utilities.css.map
β βββ bootstrap-utilities.min.css
β βββ bootstrap-utilities.min.css.map
β βββ bootstrap-utilities.rtl.css
β βββ bootstrap-utilities.rtl.css.map
β βββ bootstrap-utilities.rtl.min.css
β βββ bootstrap-utilities.rtl.min.css.map
β βββ bootstrap.css
β βββ bootstrap.css.map
β βββ bootstrap.min.css
β βββ bootstrap.min.css.map
β βββ bootstrap.rtl.css
β βββ bootstrap.rtl.css.map
β βββ bootstrap.rtl.min.css
β βββ bootstrap.rtl.min.css.map
βββ js/
βββ bootstrap.bundle.js
βββ bootstrap.bundle.js.map
βββ bootstrap.bundle.min.js
βββ bootstrap.bundle.min.js.map
βββ bootstrap.esm.js
βββ bootstrap.esm.js.map
βββ bootstrap.esm.min.js
βββ bootstrap.esm.min.js.map
βββ bootstrap.js
βββ bootstrap.js.map
βββ bootstrap.min.js
βββ bootstrap.min.js.mapWe provide compiled CSS and JS (bootstrap.*), as well as compiled and minified CSS and JS (bootstrap.min.*). Source maps (bootstrap.*.map) are available for use with certain browsersβ developer tools. Bundled JS files (bootstrap.bundle.js and minified bootstrap.bundle.min.js) include Popper.
Bugs and feature requests
Have a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.
Documentation
Bootstrapβs documentation, included in this repo in the root directory, is built with Astro and publicly hosted on GitHub Pages at https://getbootstrap.com/. The docs may also be run locally.
Documentation search is powered by Algolia's DocSearch.
Running documentation locally
- Run
npm installto install the Node.js dependencies, including Astro (the site builder). - Run
npm run test(or a specific npm script) to rebuild distributed CSS and JavaScript files, as well as our docs assets. - From the root
/bootstrapdirectory, runnpm run docs-servein the command line. - Open http://localhost:9001 in your browser, and voilΓ .
Learn more about using Astro by reading its documentation.
Documentation for previous releases
You can find all our previous releases docs on https://getbootstrap.com/docs/versions/.
Previous releases and their documentation are also available for download.
Contributing
Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.
Moreover, if your pull request contains JavaScript patches or features, you must include relevant unit tests. All HTML and CSS should conform to the Code Guide, maintained by Mark Otto.
Editor preferences are available in the editor config for easy use in common text editors. Read more and download plugins at https://editorconfig.org/.
Community
Get updates on Bootstrapβs development and chat with the project maintainers and community members.
- Follow @getbootstrap on X.
- Read and subscribe to The Official Bootstrap Blog.
- Ask questions and explore our GitHub Discussions.
- Discuss, ask questions, and more on the community Discord or Bootstrap subreddit.
- Chat with fellow Bootstrappers in IRC. On the
irc.libera.chatserver, in the#bootstrapchannel. - Implementation help may be found at Stack Overflow (tagged
bootstrap-5). - Developers should use the keyword
bootstrapon packages which modify or add to the functionality of Bootstrap when distributing through npm or similar delivery mechanisms for maximum discoverability.
Versioning
For transparency into our release cycle and in striving to maintain backward compatibility, Bootstrap is maintained under the Semantic Versioning guidelines. Sometimes we screw up, but we adhere to those rules whenever possible.
See the Releases section of our GitHub project for changelogs for each release version of Bootstrap. Release announcement posts on the official Bootstrap blog contain summaries of the most noteworthy changes made in each release.
Creators
Mark Otto
Jacob Thornton
Thanks
Thanks to BrowserStack for providing the infrastructure that allows us to test in real browsers!
Thanks to Netlify for providing us with Deploy Previews!
Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]
Backers
Thank you to all our backers! π [Become a backer]
Copyright and license
Code and documentation copyright 2011-2026 the Bootstrap Authors. Code released under the MIT License. Docs released under Creative Commons.
File: site/src/content/callouts/danger-async-methods.md
All API methods are asynchronous and start a transition. They return to the caller as soon as the transition is started, but before it ends. In addition, a method call on a transitioning component will be ignored. Learn more in our JavaScript docs.
File: site/src/content/callouts/info-mediaqueries-breakpoints.md
Why subtract .02px? Browsers donβt currently support range context queries, so we work around the limitations of min- and max- prefixes and viewports with fractional widths (which can occur under certain conditions on high-dpi devices, for instance) by using values with higher precision.
File: site/src/content/callouts/info-npm-starter.md
Get started with Bootstrap via npm with our starter project! Head to the Sass & JS example template repository to see how to build and customize Bootstrap in your own npm project. Includes Sass compiler, Autoprefixer, Stylelint, PurgeCSS, and Bootstrap Icons.
File: site/src/content/callouts/info-prefersreducedmotion.md
The animation effect of this component is dependent on the prefers-reduced-motion media query. See the reduced motion section of our accessibility documentation.
File: site/src/content/callouts/info-sanitizer.md
By default, this component uses the built-in content sanitizer, which strips out any HTML elements that are not explicitly allowed. See the sanitizer section in our JavaScript documentation for more details.
File: site/src/content/callouts/warning-color-assistive-technologies.md
Accessibility tip: Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies like screen readers. Please ensure the meaning is obvious from the content itself (e.g., the visible text with a sufficient color contrast) or is included through alternative means, such as additional text hidden with the .visually-hidden class.
File: site/src/content/callouts/warning-data-bs-title-vs-title.md
Feel free to use either title or data-bs-title in your HTML. When title is used, Popper will replace it automatically with data-bs-title when the element is rendered.
File: site/src/content/callouts/warning-input-support.md
Some date inputs types are not fully supported by the latest versions of Safari and Firefox.
File: site/src/content/docs/customize/color.mdx
title: Color toc: true
import { getData } from '@libs/data'
import { getSequence } from '@libs/utils'
Colors
Bootstrapβs color palette has continued to expand and become more nuanced in v5.3.0. Weβve added new variables for secondary and tertiary text and background colors, plus {color}-bg-subtle, {color}-border-subtle, and {color}-text-emphasis for our theme colors. These new colors are available through Sass and CSS variables (but not our color maps or utility classes) with the express goal of making it easier to customize across multiple colors modes like light and dark. These new variables are globally set on :root and are adapted for our new dark color mode while our original theme colors remain unchanged.
Colors ending in -rgb provide the red, green, blue values for use in rgb() and rgba() color modes. For example, rgba(var(--bs-secondary-bg-rgb), .5).
| Description | Swatch | Variables |
|---|---|---|
| Body β Default foreground (color) and background, including components. | --bs-body-color``--bs-body-color-rgb |
|
--bs-body-bg``--bs-body-bg-rgb |
||
Secondary β Use the color option for lighter text. Use the bg option for dividers and to indicate disabled component states. |
--bs-secondary-color``--bs-secondary-color-rgb |
|
--bs-secondary-bg``--bs-secondary-bg-rgb |
||
Tertiary β Use the color option for even lighter text. Use the bg option to style backgrounds for hover states, accents, and wells. |
--bs-tertiary-color``--bs-tertiary-color-rgb |
|
--bs-tertiary-bg``--bs-tertiary-bg-rgb |
||
| Emphasis β For higher contrast text. Not applicable for backgrounds. | --bs-emphasis-color``--bs-emphasis-color-rgb |
|
Border β For component borders, dividers, and rules. Use --bs-border-color-translucent to blend with backgrounds with an rgba() value. |
--bs-border-color``--bs-border-color-rgb |
|
| Primary β Main theme color, used for hyperlinks, focus styles, and component and form active states. | --bs-primary``--bs-primary-rgb |
|
--bs-primary-bg-subtle |
||
--bs-primary-border-subtle |
||
| Text | --bs-primary-text-emphasis |
|
| Success β Theme color used for positive or successful actions and information. | --bs-success``--bs-success-rgb |
|
--bs-success-bg-subtle |
||
--bs-success-border-subtle |
||
| Text | --bs-success-text-emphasis |
|
| Danger β Theme color used for errors and dangerous actions. | --bs-danger``--bs-danger-rgb |
|
--bs-danger-bg-subtle |
||
--bs-danger-border-subtle |
||
| Text | --bs-danger-text-emphasis |
|
| Warning β Theme color used for non-destructive warning messages. | --bs-warning``--bs-warning-rgb |
|
--bs-warning-bg-subtle |
||
--bs-warning-border-subtle |
||
| Text | --bs-warning-text-emphasis |
|
| Info β Theme color used for neutral and informative content. | --bs-info``--bs-info-rgb |
|
--bs-info-bg-subtle |
||
--bs-info-border-subtle |
||
| Text | --bs-info-text-emphasis |
|
| Light β Additional theme option for less contrasting colors. | --bs-light``--bs-light-rgb |
|
--bs-light-bg-subtle |
||
--bs-light-border-subtle |
||
| Text | --bs-light-text-emphasis |
|
| Dark β Additional theme option for higher contrasting colors. | --bs-dark``--bs-dark-rgb |
|
--bs-dark-bg-subtle |
||
--bs-dark-border-subtle |
||
| Text | --bs-dark-text-emphasis |
Using the new colors
These new colors are accessible via CSS variables and utility classesβlike --bs-primary-bg-subtle and .bg-primary-subtleβallowing you to compose your own CSS rules with the variables, or to quickly apply styles via classes. The utilities are built with the colorβs associated CSS variables, and since we customize those CSS variables for dark mode, they are also adaptive to color mode by default.
<Example code={ Example element with utilities } />
Theme colors
We use a subset of all colors to create a smaller color palette for generating color schemes, also available as Sass variables and a Sass map in Bootstrapβs scss/_variables.scss file.
{getData('theme-colors').map((themeColor) => {
return (
{themeColor.title}
)})}
All these colors are available as a Sass map, $theme-colors.
Check out our Sass maps and loops docs for how to modify these colors.
All colors
All Bootstrap colors are available as Sass variables and a Sass map in scss/_variables.scss file. To avoid increased file sizes, we donβt create text or background color classes for each of these variables. Instead, we choose a subset of these colors for a theme palette.
Be sure to monitor contrast ratios as you customize colors. As shown below, weβve added three contrast ratios to each of the main colorsβone for the swatchβs current colors, one for against white, and one for against black.
{getData('colors').map((color) => {
if ((color.name !== "white") && (color.name !== "gray") && (color.name !== "gray-dark")) {
return (
${color.name}
{color.hex}
{getSequence(100, 900, 100).map((value) => {
return (
${color.name}-{value}
)
})}
)
}})}
$gray-500#adb5bd
{getData('grays').map((gray) => {
return (
$gray-{gray.name}
)
})}
$black
#000
$white
#fffNotes on Sass
Sass cannot programmatically generate variables, so we manually created variables for every tint and shade ourselves. We specify the midpoint value (e.g., $blue-500) and use custom color functions to tint (lighten) or shade (darken) our colors via Sassβs mix() color function.
Using mix() is not the same as lighten() and darken()βthe former blends the specified color with white or black, while the latter only adjusts the lightness value of each color. The result is a much more complete suite of colors, as shown in this CodePen demo.
Our tint-color() and shade-color() functions use mix() alongside our $theme-color-interval variable, which specifies a stepped percentage value for each mixed color we produce. See the scss/_functions.scss and scss/_variables.scss files for the full source code.
Color Sass maps
Bootstrapβs source Sass files include three maps to help you quickly and easily loop over a list of colors and their hex values.
$colorslists all our available base (500) colors$theme-colorslists all semantically named theme colors (shown below)$grayslists all tints and shades of gray
Within scss/_variables.scss, youβll find Bootstrapβs color variables and Sass map. Hereβs an example of the $colors Sass map:
Add, remove, or modify values within the map to update how theyβre used in many other components. Unfortunately at this time, not every component utilizes this Sass map. Future updates will strive to improve upon this. Until then, plan on making use of the ${color} variables and this Sass map.
Example
Hereβs how you can use these in your Sass:
.alpha { color: $purple; }
.beta {
color: $yellow-300;
background-color: $indigo-900;
}Color and background utility classes are also available for setting color and background-color using the 500 color values.
Generating utilities
Bootstrap doesnβt include color and background-color utilities for every color variable, but you can generate these yourself with our utility API and our extended Sass maps added in v5.1.0.
- To start, make sure youβve imported our functions, variables, mixins, and utilities.
- Use our
map-merge-multiple()function to quickly merge multiple Sass maps together in a new map. - Merge this new combined map to extend any utility with a
{color}-{level}class name.
Hereβs an example that generates text color utilities (e.g., .text-purple-500) using the above steps.
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/variables-dark";
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
$all-colors: map-merge-multiple($blues, $indigos, $purples, $pinks, $reds, $oranges, $yellows, $greens, $teals, $cyans);
$utilities: map-merge(
$utilities,
(
"color": map-merge(
map-get($utilities, "color"),
(
values: map-merge(
map-get(map-get($utilities, "color"), "values"),
(
$all-colors
),
),
),
),
)
);
@import "bootstrap/scss/utilities/api";This will generate new .text-{color}-{level} utilities for every color and level. You can do the same for any other utility and property as well.