<metaname="description"content="Track and review changes to the Bootstrap source files, documentation, and components to help you migrate from v4 to v5.">
<metaname="author"content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
<metaname="twitter:title"content="Migrating to v5">
<metaname="twitter:description"content="Track and review changes to the Bootstrap source files, documentation, and components to help you migrate from v4 to v5.">
<metaproperty="og:title"content="Migrating to v5">
<metaproperty="og:description"content="Track and review changes to the Bootstrap source files, documentation, and components to help you migrate from v4 to v5.">
<aclass="btn btn-sm btn-bd-light mb-3 mb-md-0 rounded-2"href="https://github.com/twbs/bootstrap/blob/main/site/content/docs/5.2/migration.md"title="View and edit this file on GitHub"target="_blank"rel="noopener">
View on GitHub
</a>
<h1class="bd-title mb-0"id="content">Migrating to v5</h1>
</div>
<pclass="bd-lead">Track and review changes to the Bootstrap source files, documentation, and components to help you migrate from v4 to v5.</p>
<h2id="v520">v5.2.0 <aclass="anchor-link"href="#v520"aria-label="Link to this section: v5.2.0"></a></h2>
<hrclass="mb-4">
<h3id="refreshed-design">Refreshed design <aclass="anchor-link"href="#refreshed-design"aria-label="Link to this section: Refreshed design"></a></h3>
<p>Bootstrap v5.2.0 features a subtle design update for a handful of components and properties across the project, <strong>most notably through refined <code>border-radius</code> values on buttons and form controls</strong>. Our documentation also has been updated with a new homepage, simpler docs layout that no longer collapses sections of the sidebar, and more prominent examples of <ahref="https://icons.getbootstrap.com">Bootstrap Icons</a>.</p>
<h3id="more-css-variables">More CSS variables <aclass="anchor-link"href="#more-css-variables"aria-label="Link to this section: More CSS variables"></a></h3>
<p><strong>We’ve updated all our components to use CSS variables.</strong> While Sass still underpins everything, each component has been updated to include CSS variables on the component base classes (e.g., <code>.btn</code>), allowing for more real-time customization of Bootstrap. In subsequent releases, we’ll continue to expand our use of CSS variables into our layout, forms, helpers, and utilities. Read more about CSS variables in each component on their respective documentation pages.</p>
<p>Our CSS variable usage will be somewhat incomplete until Bootstrap 6. While we’d love to fully implement these across the board, they do run the risk of causing breaking changes. For example, setting <code>$alert-border-width: var(--bs-border-width)</code> in our source code breaks potential Sass in your own code if you were doing <code>$alert-border-width * 2</code> for some reason.</p>
<p>As such, wherever possible, we will continue to push towards more CSS variables, but please recognize our implementation may be slightly limited in v5.</p>
<h3id="new-_mapsscss">New <code>_maps.scss</code><aclass="anchor-link"href="#new-_mapsscss"aria-label="Link to this section: New _maps.scss"></a></h3>
<p><strong>Bootstrap v5.2.0 introduced a new Sass file with <code>_maps.scss</code>.</strong> It pulls out several Sass maps from <code>_variables.scss</code> to fix an issue where updates to an original map were not applied to secondary maps that extend them. For example, updates to <code>$theme-colors</code> were not being applied to other theme maps that relied on <code>$theme-colors</code>, breaking key customization workflows. In short, Sass has a limitation where once a default variable or map has been <em>used</em>, it cannot be updated. <em>There’s a similar shortcoming with CSS variables when they’re used to compose other CSS variables.</em></p>
<p>This is why variable customizations in Bootstrap have to come after <code>@import "functions"</code>, but before <code>@import "variables"</code> and the rest of our import stack. The same applies to Sass maps—you must override the defaults before they get used. The following maps have been moved to the new <code>_maps.scss</code>:</p>
<ul>
<li><code>$theme-colors-rgb</code></li>
<li><code>$utilities-colors</code></li>
<li><code>$utilities-text</code></li>
<li><code>$utilities-text-colors</code></li>
<li><code>$utilities-bg</code></li>
<li><code>$utilities-bg-colors</code></li>
<li><code>$negative-spacers</code></li>
<li><code>$gutters</code></li>
</ul>
<p>Your custom Bootstrap CSS builds should now look something like this with a separate maps import.</p>
<divclass="highlight"><pretabindex="0"class="chroma"><codeclass="language-diff"data-lang="diff"><spanclass="line"><spanclass="cl"> // Functions come first
</span></span></code></pre></div><h3id="new-utilities">New utilities <aclass="anchor-link"href="#new-utilities"aria-label="Link to this section: New utilities"></a></h3>
<ul>
<li>Expanded <ahref="/docs/5.2/utilities/text/#font-weight-and-italics"><code>font-weight</code> utilities</a> to include <code>.fw-semibold</code> for semibold fonts.</li>
<li>Expanded <ahref="/docs/5.2/utilities/borders/#sizes"><code>border-radius</code> utilities</a> to include two new sizes, <code>.rounded-4</code> and <code>.rounded-5</code>, for more options.</li>
</ul>
<h3id="additional-changes">Additional changes <aclass="anchor-link"href="#additional-changes"aria-label="Link to this section: Additional changes"></a></h3>
<ul>
<li>
<p><strong>Introduced new <code>$enable-container-classes</code> option. —</strong> Now when opting into the experimental CSS Grid layout, <code>.container-*</code> classes will still be compiled, unless this option is set to <code>false</code>. Containers also now keep their gutter values.</p>
</li>
<li>
<p><strong>Offcanvas component now has <ahref="/docs/5.2/components/offcanvas/#responsive">responsive variations</a>.</strong> The original <code>.offcanvas</code> class remains unchanged—it hides content across all viewports. To make it responsive, change that <code>.offcanvas</code> class to any <code>.offcanvas-{sm|md|lg|xl|xxl}</code> class.</p>
</li>
<li>
<p><strong>Thicker table dividers are now opt-in. —</strong> We’ve removed the thicker and more difficult to override border between table groups and moved it to an optional class you can apply, <code>.table-group-divider</code>. <ahref="/docs/5.2/content/tables/#table-group-dividers">See the table docs for an example.</a></p>
</li>
<li>
<p><strong><ahref="https://github.com/twbs/bootstrap/pull/33421">Scrollspy has been rewritten</a> to use the Intersection Observer API</strong>, which means you no longer need relative parent wrappers, deprecates <code>offset</code> config, and more. Look for your Scrollspy implementations to be more accurate and consistent in their nav highlighting.</p>
</li>
<li>
<p><strong>Popovers and tooltips now use CSS variables.</strong> Some CSS variables have been updated from their Sass counterparts to reduce the number of variables. As a result, three variables have been deprecated in this release: <code>$popover-arrow-color</code>, <code>$popover-arrow-outer-color</code>, and <code>$tooltip-arrow-color</code>.</p>
</li>
<li>
<p><strong>Added new <code>.text-bg-{color}</code> helpers.</strong> Instead of setting individual <code>.text-*</code> and <code>.bg-*</code> utilities, you can now use <ahref="/docs/5.2/helpers/color-background/">the <code>.text-bg-*</code> helpers</a> to set a <code>background-color</code> with contrasting foreground <code>color</code>.</p>
</li>
<li>
<p>Added <code>.form-check-reverse</code> modifier to flip the order of labels and associated checkboxes/radios.</p>
</li>
<li>
<p>Added <ahref="/docs/5.2/content/tables/#striped-columns">striped columns</a> support to tables via the new <code>.table-striped-columns</code> class.</p>
</li>
</ul>
<p>For a complete list of changes, <ahref="https://github.com/twbs/bootstrap/projects/32">see the v5.2.0 project on GitHub</a>.</p>
<h2id="v510">v5.1.0 <aclass="anchor-link"href="#v510"aria-label="Link to this section: v5.1.0"></a></h2>
<hrclass="mb-4">
<ul>
<li>
<p><strong>Added experimental support for <ahref="/docs/5.2/layout/css-grid/">CSS Grid layout</a>. —</strong> This is a work in progress, and is not yet ready for production use, but you can opt into the new feature via Sass. To enable it, disable the default grid, by setting <code>$enable-grid-classes: false</code> and enable the CSS Grid by setting <code>$enable-cssgrid: true</code>.</p>
</li>
<li>
<p><strong>Updated navbars to support offcanvas. —</strong> Add <ahref="/docs/5.2/components/navbar/#offcanvas">offcanvas drawers in any navbar</a> with the responsive <code>.navbar-expand-*</code> classes and some offcanvas markup.</p>
</li>
<li>
<p><strong>Added new <ahref="/docs/5.2/components/placeholders/">placeholder component</a>. —</strong> Our newest component, a way to provide temporary blocks in lieu of real content to help indicate that something is still loading in your site or app.</p>
</li>
<li>
<p><strong>Collapse plugin now supports <ahref="/docs/5.2/components/collapse/#horizontal">horizontal collapsing</a>. —</strong> Add <code>.collapse-horizontal</code> to your <code>.collapse</code> to collapse the <code>width</code> instead of the <code>height</code>. Avoid browser repainting by setting a <code>min-height</code> or <code>height</code>.</p>
</li>
<li>
<p><strong>Added new stack and vertical rule helpers. —</strong> Quickly apply multiple flexbox properties to quickly create custom layouts with <ahref="/docs/5.2/helpers/stacks/">stacks</a>. Choose from horizontal (<code>.hstack</code>) and vertical (<code>.vstack</code>) stacks. Add vertical dividers similar to <code><hr></code> elements with the <ahref="/docs/5.2/helpers/vertical-rule/">new <code>.vr</code> helpers</a>.</p>
</li>
<li>
<p><strong>Added new global <code>:root</code> CSS variables. —</strong> Added several new CSS variables to the <code>:root</code> level for controlling <code><body></code> styles. More are in the works, including across our utilities and components, but for now read up <ahref="/docs/5.2/customize/css-variables/">CSS variables in the Customize section</a>.</p>
</li>
<li>
<p><strong>Overhauled color and background utilities to use CSS variables, and added new <ahref="/docs/5.2/utilities/text/#opacity">text opacity</a> and <ahref="/docs/5.2/utilities/background/#opacity">background opacity</a> utilities. —</strong><code>.text-*</code> and <code>.bg-*</code> utilities are now built with CSS variables and <code>rgba()</code> color values, allowing you to easily customize any utility with new opacity utilities.</p>
</li>
<li>
<p><strong>Added new snippet examples based to show how to customize our components. —</strong> Pull ready to use customized components and other common design patterns with our new <ahref="/docs/5.2/examples/#snippets">Snippets examples</a>. Includes <ahref="/docs/5.2/examples/footers/">footers</a>, <ahref="/docs/5.2/examples/dropdowns/">dropdowns</a>, <ahref="/docs/5.2/examples/list-groups/">list groups</a>, and <ahref="/docs/5.2/examples/modals/">modals</a>.</p>
</li>
<li>
<p><strong>Removed unused positioning styles from popovers and tooltips</strong> as these are handled solely by Popper. <code>$tooltip-margin</code> has been deprecated and set to <code>null</code> in the process.</p>
</li>
</ul>
<p>Want more information? <ahref="https://blog.getbootstrap.com/2021/08/04/bootstrap-5-1-0/">Read the v5.1.0 blog post.</a></p>
<hrclass="my-5">
<divclass="bd-callout bd-callout-info">
<strong>Hey there!</strong> Changes to our first major release of Bootstrap 5, v5.0.0, are documented below. They don’t reflect the additional changes shown above.
</div>
<h2id="dependencies">Dependencies <aclass="anchor-link"href="#dependencies"aria-label="Link to this section: Dependencies"></a></h2>
<ul>
<li>Dropped jQuery.</li>
<li>Upgraded from Popper v1.x to Popper v2.x.</li>
<li>Replaced Libsass with Dart Sass as our Sass compiler given Libsass was deprecated.</li>
<li>Migrated from Jekyll to Hugo for building our documentation</li>
</ul>
<h2id="browser-support">Browser support <aclass="anchor-link"href="#browser-support"aria-label="Link to this section: Browser support"></a></h2>
<ul>
<li>Dropped Internet Explorer 10 and 11</li>
<li>Dropped Microsoft Edge < 16 (Legacy Edge)</li>
<li>Dropped Firefox < 60</li>
<li>Dropped Safari < 12</li>
<li>Dropped iOS Safari < 12</li>
<li>Dropped Chrome < 60</li>
</ul>
<hrclass="my-5">
<h2id="documentation-changes">Documentation changes <aclass="anchor-link"href="#documentation-changes"aria-label="Link to this section: Documentation changes"></a></h2>
<ul>
<li>Redesigned homepage, docs layout, and footer.</li>
<li>Added <ahref="/docs/5.2/customize/overview/">new Customize section</a>, replacing <ahref="https://getbootstrap.com/docs/4.6/getting-started/theming/">v4’s Theming page</a>, with new details on Sass, global configuration options, color schemes, CSS variables, and more.</li>
<li>Reorganized all form documentation into <ahref="/docs/5.2/forms/overview/">new Forms section</a>, breaking apart the content into more focused pages.</li>
<li>Similarly, updated <ahref="/docs/5.2/layout/breakpoints/">the Layout section</a>, to flesh out grid content more clearly.</li>
<li>Renamed “Navs” component page to “Navs & Tabs”.</li>
<li>Renamed “Checks” page to “Checks & radios”.</li>
<li>Redesigned the navbar and added a new subnav to make it easier to get around our sites and docs versions.</li>
<li>Added new keyboard shortcut for the search field: <kbd>Ctrl + /</kbd>.</li>
</ul>
<h2id="sass">Sass <aclass="anchor-link"href="#sass"aria-label="Link to this section: Sass"></a></h2>
<ul>
<li>
<p>We’ve ditched the default Sass map merges to make it easier to remove redundant values. Keep in mind you now have to define all values in the Sass maps like <code>$theme-colors</code>. Check out how to deal with <ahref="/docs/5.2/customize/sass/#maps-and-loops">Sass maps</a>.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Renamed <code>color-yiq()</code> function and related variables to <code>color-contrast()</code> as it’s no longer related to YIQ color space. <ahref="https://github.com/twbs/bootstrap/pull/30168/">See #30168.</a></p>
<ul>
<li><code>$yiq-contrasted-threshold</code> is renamed to <code>$min-contrast-ratio</code>.</li>
<li><code>$yiq-text-dark</code> and <code>$yiq-text-light</code> are respectively renamed to <code>$color-contrast-dark</code> and <code>$color-contrast-light</code>.</li>
</ul>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Media query mixins parameters have changed for a more logical approach.</p>
<ul>
<li><code>media-breakpoint-down()</code> uses the breakpoint itself instead of the next breakpoint (e.g., <code>media-breakpoint-down(lg)</code> instead of <code>media-breakpoint-down(md)</code> targets viewports smaller than <code>lg</code>).</li>
<li>Similarly, the second parameter in <code>media-breakpoint-between()</code> also uses the breakpoint itself instead of the next breakpoint (e.g., <code>media-between(sm, lg)</code> instead of <code>media-breakpoint-between(sm, md)</code> targets viewports between <code>sm</code> and <code>lg</code>).</li>
</ul>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Removed print styles and <code>$enable-print-styles</code> variable. Print display classes are still around. <ahref="https://github.com/twbs/bootstrap/pull/28339">See #28339</a>.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Dropped <code>color()</code>, <code>theme-color()</code>, and <code>gray()</code> functions in favor of variables. <ahref="https://github.com/twbs/bootstrap/pull/29083">See #29083</a>.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Renamed <code>theme-color-level()</code> function to <code>color-level()</code> and now accepts any color you want instead of only <code>$theme-color</code> colors. <ahref="https://github.com/twbs/bootstrap/pull/29083">See #29083</a><strong>Watch out:</strong><code>color-level()</code> was later on dropped in <code>v5.0.0-alpha3</code>.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Renamed <code>$enable-prefers-reduced-motion-media-query</code> and <code>$enable-pointer-cursor-for-buttons</code> to <code>$enable-reduced-motion</code> and <code>$enable-button-pointers</code> for brevity.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Removed the <code>bg-gradient-variant()</code> mixin. Use the <code>.bg-gradient</code> class to add gradients to elements instead of the generated <code>.bg-gradient-*</code> classes.</p>
<li><code>hover</code>, <code>hover-focus</code>, <code>plain-hover-focus</code>, and <code>hover-focus-active</code></li>
<li><code>float()</code></li>
<li><code>form-control-mixin()</code></li>
<li><code>nav-divider()</code></li>
<li><code>retina-img()</code></li>
<li><code>text-hide()</code> (also dropped the associated utility class, <code>.text-hide</code>)</li>
<li><code>visibility()</code></li>
<li><code>form-control-focus()</code></li>
</ul>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Renamed <code>scale-color()</code> function to <code>shift-color()</code> to avoid collision with Sass’s own color scaling function.</p>
</li>
<li>
<p><code>box-shadow</code> mixins now allow <code>null</code> values and drop <code>none</code> from multiple arguments. <ahref="https://github.com/twbs/bootstrap/pull/30394">See #30394</a>.</p>
</li>
<li>
<p>The <code>border-radius()</code> mixin now has a default value.</p>
</li>
</ul>
<h2id="color-system">Color system <aclass="anchor-link"href="#color-system"aria-label="Link to this section: Color system"></a></h2>
<ul>
<li>
<p>The color system which worked with <code>color-level()</code> and <code>$theme-color-interval</code> was removed in favor of a new color system. All <code>lighten()</code> and <code>darken()</code> functions in our codebase are replaced by <code>tint-color()</code> and <code>shade-color()</code>. These functions will mix the color with either white or black instead of changing its lightness by a fixed amount. The <code>shift-color()</code> will either tint or shade a color depending on whether its weight parameter is positive or negative. <ahref="https://github.com/twbs/bootstrap/pull/30622">See #30622</a> for more details.</p>
</li>
<li>
<p>Added new tints and shades for every color, providing nine separate colors for each base color, as new Sass variables.</p>
</li>
<li>
<p>Improved color contrast. Bumped color contrast ratio from 3:1 to 4.5:1 and updated blue, green, cyan, and pink colors to ensure WCAG 2.1 AA contrast. Also changed our color contrast color from <code>$gray-900</code> to <code>$black</code>.</p>
</li>
<li>
<p>To support our color system, we’ve added new custom <code>tint-color()</code> and <code>shade-color()</code> functions to mix our colors appropriately.</p>
</li>
</ul>
<h2id="grid-updates">Grid updates <aclass="anchor-link"href="#grid-updates"aria-label="Link to this section: Grid updates"></a></h2>
<ul>
<li>
<p><strong>New breakpoint!</strong> Added new <code>xxl</code> breakpoint for <code>1400px</code> and up. No changes to all other breakpoints.</p>
</li>
<li>
<p><strong>Improved gutters.</strong> Gutters are now set in rems, and are narrower than v4 (<code>1.5rem</code>, or about <code>24px</code>, down from <code>30px</code>). This aligns our grid system’s gutters with our spacing utilities.</p>
<ul>
<li>Added new <ahref="/docs/5.2/layout/gutters/">gutter class</a> (<code>.g-*</code>, <code>.gx-*</code>, and <code>.gy-*</code>) to control horizontal/vertical gutters, horizontal gutters, and vertical gutters.</li>
<li><spanclass="badge bg-danger">Breaking</span> Renamed <code>.no-gutters</code> to <code>.g-0</code> to match new gutter utilities.</li>
</ul>
</li>
<li>
<p>Columns no longer have <code>position: relative</code> applied, so you may have to add <code>.position-relative</code> to some elements to restore that behavior.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Dropped several <code>.order-*</code> classes that often went unused. We now only provide <code>.order-1</code> to <code>.order-5</code> out of the box.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Dropped the <code>.media</code> component as it can be easily replicated with utilities. <ahref="https://github.com/twbs/bootstrap/pull/28265">See #28265</a> and the <ahref="/docs/5.2/utilities/flex/#media-object">flex utilities page for an example</a>.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span><code>bootstrap-grid.css</code> now only applies <code>box-sizing: border-box</code> to the column instead of resetting the global box-sizing. This way, our grid styles can be used in more places without interference.</p>
</li>
<li>
<p><code>$enable-grid-classes</code> no longer disables the generation of container classes anymore. <ahref="https://github.com/twbs/bootstrap/pull/29146">See #29146.</a></p>
</li>
<li>
<p>Updated the <code>make-col</code> mixin to default to equal columns without a specified size.</p>
</li>
</ul>
<h2id="content-reboot-etc">Content, Reboot, etc <aclass="anchor-link"href="#content-reboot-etc"aria-label="Link to this section: Content, Reboot, etc"></a></h2>
<ul>
<li>
<p><strong><ahref="/docs/5.2/getting-started/rfs/">RFS</a> is now enabled by default.</strong> Headings using the <code>font-size()</code> mixin will automatically adjust their <code>font-size</code> to scale with the viewport. <em>This feature was previously opt-in with v4.</em></p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Overhauled our display typography to replace our <code>$display-*</code> variables and with a <code>$display-font-sizes</code> Sass map. Also removed the individual <code>$display-*-weight</code> variables for a single <code>$display-font-weight</code> and adjusted <code>font-size</code>s.</p>
</li>
<li>
<p>Added two new <code>.display-*</code> heading sizes, <code>.display-5</code> and <code>.display-6</code>.</p>
</li>
<li>
<p><strong>Links are underlined by default</strong> (not just on hover), unless they’re part of specific components.</p>
</li>
<li>
<p><strong>Redesigned tables</strong> to refresh their styles and rebuild them with CSS variables for more control over styling.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Nested tables do not inherit styles anymore.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span><code>.thead-light</code> and <code>.thead-dark</code> are dropped in favor of the <code>.table-*</code> variant classes which can be used for all table elements (<code>thead</code>, <code>tbody</code>, <code>tfoot</code>, <code>tr</code>, <code>th</code> and <code>td</code>).</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> The <code>table-row-variant()</code> mixin is renamed to <code>table-variant()</code> and accepts only 2 parameters: <code>$color</code> (color name) and <code>$value</code> (color code). The border color and accent colors are automatically calculated based on the table factor variables.</p>
</li>
<li>
<p>Split table cell padding variables into <code>-y</code> and <code>-x</code>.</p>
<p><spanclass="badge bg-danger">Breaking</span><code>.text-*</code> utilities do not add hover and focus states to links anymore. <code>.link-*</code> helper classes can be used instead. <ahref="https://github.com/twbs/bootstrap/pull/29267">See #29267</a></p>
<p><spanclass="badge bg-danger">Breaking</span><del><code><hr></code> elements now use <code>height</code> instead of <code>border</code> to better support the <code>size</code> attribute. This also enables use of padding utilities to create thicker dividers (e.g., <code><hr class="py-1"></code>).</del></p>
</li>
<li>
<p>Reset default horizontal <code>padding-left</code> on <code><ul></code> and <code><ol></code> elements from browser default <code>40px</code> to <code>2rem</code>.</p>
</li>
<li>
<p>Added <code>$enable-smooth-scroll</code>, which applies <code>scroll-behavior: smooth</code> globally—except for users asking for reduced motion through <code>prefers-reduced-motion</code> media query. <ahref="https://github.com/twbs/bootstrap/pull/31877">See #31877</a></p>
</li>
</ul>
<h2id="rtl">RTL <aclass="anchor-link"href="#rtl"aria-label="Link to this section: RTL"></a></h2>
<ul>
<li>Horizontal direction specific variables, utilities, and mixins have all been renamed to use logical properties like those found in flexbox layouts—e.g., <code>start</code> and <code>end</code> in lieu of <code>left</code> and <code>right</code>.</li>
</ul>
<h2id="forms">Forms <aclass="anchor-link"href="#forms"aria-label="Link to this section: Forms"></a></h2>
<ul>
<li>
<p><strong>Added new floating forms!</strong> We’ve promoted the Floating labels example to fully supported form components. <ahref="/docs/5.2/forms/floating-labels/">See the new Floating labels page.</a></p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span><strong>Consolidated native and custom form elements.</strong> Checkboxes, radios, selects, and other inputs that had native and custom classes in v4 have been consolidated. Now nearly all our form elements are entirely custom, most without the need for custom HTML.</p>
<ul>
<li><code>.custom-control.custom-checkbox</code> is now <code>.form-check</code>.</li>
<li><code>.custom-control.custom-custom-radio</code> is now <code>.form-check</code>.</li>
<li><code>.custom-control.custom-switch</code> is now <code>.form-check.form-switch</code>.</li>
<li><code>.custom-select</code> is now <code>.form-select</code>.</li>
<li><code>.custom-file</code> and <code>.form-file</code> have been replaced by custom styles on top of <code>.form-control</code>.</li>
<li><code>.custom-range</code> is now <code>.form-range</code>.</li>
<li>Dropped native <code>.form-control-file</code> and <code>.form-control-range</code>.</li>
</ul>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Dropped <code>.input-group-append</code> and <code>.input-group-prepend</code>. You can now just add buttons and <code>.input-group-text</code> as direct children of the input groups.</p>
</li>
<li>
<p>The longstanding <ahref="https://github.com/twbs/bootstrap/issues/25110">Missing border radius on input group with validation feedback bug</a> is finally fixed by adding an additional <code>.has-validation</code> class to input groups with validation.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span><strong>Dropped form-specific layout classes for our grid system.</strong> Use our grid and utilities instead of <code>.form-group</code>, <code>.form-row</code>, or <code>.form-inline</code>.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Form labels now require <code>.form-label</code>.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span><code>.form-text</code> no longer sets <code>display</code>, allowing you to create inline or block help text as you wish just by changing the HTML element.</p>
</li>
<li>
<p>Form controls no longer used fixed <code>height</code> when possible, instead deferring to <code>min-height</code> to improve customization and compatibility with other components.</p>
</li>
<li>
<p>Validation icons are no longer applied to <code><select></code>s with <code>multiple</code>.</p>
</li>
<li>
<p>Rearranged source Sass files under <code>scss/forms/</code>, including input group styles.</p>
</li>
</ul>
<hrclass="my-5">
<h2id="components">Components <aclass="anchor-link"href="#components"aria-label="Link to this section: Components"></a></h2>
<ul>
<li>Unified <code>padding</code> values for alerts, breadcrumbs, cards, dropdowns, list groups, modals, popovers, and tooltips to be based on our <code>$spacer</code> variable. <ahref="https://github.com/twbs/bootstrap/pull/30564">See #30564</a>.</li>
</ul>
<h3id="accordion">Accordion <aclass="anchor-link"href="#accordion"aria-label="Link to this section: Accordion"></a></h3>
<h3id="alerts">Alerts <aclass="anchor-link"href="#alerts"aria-label="Link to this section: Alerts"></a></h3>
<ul>
<li>
<p>Alerts now have <ahref="/docs/5.2/components/alerts/#icons">examples with icons</a>.</p>
</li>
<li>
<p>Removed custom styles for <code><hr></code>s in each alert since they already use <code>currentColor</code>.</p>
</li>
</ul>
<h3id="badges">Badges <aclass="anchor-link"href="#badges"aria-label="Link to this section: Badges"></a></h3>
<ul>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Dropped all <code>.badge-*</code> color classes for background utilities (e.g., use <code>.bg-primary</code> instead of <code>.badge-primary</code>).</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Dropped <code>.badge-pill</code>—use the <code>.rounded-pill</code> utility instead.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Removed hover and focus styles for <code><a></code> and <code><button></code> elements.</p>
</li>
<li>
<p>Increased default padding for badges from <code>.25em</code>/<code>.5em</code> to <code>.35em</code>/<code>.65em</code>.</p>
</li>
</ul>
<h3id="breadcrumbs">Breadcrumbs <aclass="anchor-link"href="#breadcrumbs"aria-label="Link to this section: Breadcrumbs"></a></h3>
<ul>
<li>
<p>Simplified the default appearance of breadcrumbs by removing <code>padding</code>, <code>background-color</code>, and <code>border-radius</code>.</p>
</li>
<li>
<p>Added new CSS custom property <code>--bs-breadcrumb-divider</code> for easy customization without needing to recompile CSS.</p>
</li>
</ul>
<h3id="buttons">Buttons <aclass="anchor-link"href="#buttons"aria-label="Link to this section: Buttons"></a></h3>
<ul>
<li>
<p><spanclass="badge bg-danger">Breaking</span><strong><ahref="/docs/5.2/forms/checks-radios/#toggle-buttons">Toggle buttons</a>, with checkboxes or radios, no longer require JavaScript and have new markup.</strong> We no longer require a wrapping element, add <code>.btn-check</code> to the <code><input></code>, and pair it with any <code>.btn</code> classes on the <code><label></code>. <ahref="https://github.com/twbs/bootstrap/pull/30650">See #30650</a>. <em>The docs for this has moved from our Buttons page to the new Forms section.</em></p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span><strong>Dropped <code>.btn-block</code> for utilities.</strong> Instead of using <code>.btn-block</code> on the <code>.btn</code>, wrap your buttons with <code>.d-grid</code> and a <code>.gap-*</code> utility to space them as needed. Switch to responsive classes for even more control over them. <ahref="/docs/5.2/components/buttons/#block-buttons">Read the docs for some examples.</a></p>
</li>
<li>
<p>Updated our <code>button-variant()</code> and <code>button-outline-variant()</code> mixins to support additional parameters.</p>
</li>
<li>
<p>Updated buttons to ensure increased contrast on hover and active states.</p>
</li>
<li>
<p>Disabled buttons now have <code>pointer-events: none;</code>.</p>
</li>
</ul>
<h3id="card">Card <aclass="anchor-link"href="#card"aria-label="Link to this section: Card"></a></h3>
<ul>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Dropped <code>.card-deck</code> in favor of our grid. Wrap your cards in column classes and add a parent <code>.row-cols-*</code> container to recreate card decks (but with more control over responsive alignment).</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Dropped <code>.card-columns</code> in favor of Masonry. <ahref="https://github.com/twbs/bootstrap/pull/28922">See #28922</a>.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Replaced the <code>.card</code> based accordion with a <ahref="/docs/5.2/components/accordion/">new Accordion component</a>.</p>
</li>
</ul>
<h3id="carousel">Carousel <aclass="anchor-link"href="#carousel"aria-label="Link to this section: Carousel"></a></h3>
<ul>
<li>
<p>Added new <ahref="/docs/5.2/components/carousel/#dark-variant"><code>.carousel-dark</code> variant</a> for dark text, controls, and indicators (great for lighter backgrounds).</p>
</li>
<li>
<p>Replaced chevron icons for carousel controls with new SVGs from <ahref="https://icons.getbootstrap.com/">Bootstrap Icons</a>.</p>
</li>
</ul>
<h3id="close-button">Close button <aclass="anchor-link"href="#close-button"aria-label="Link to this section: Close button"></a></h3>
<ul>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Renamed <code>.close</code> to <code>.btn-close</code> for a less generic name.</p>
</li>
<li>
<p>Close buttons now use a <code>background-image</code> (embedded SVG) instead of a <code>&times;</code> in the HTML, allowing for easier customization without the need to touch your markup.</p>
</li>
<li>
<p>Added new <code>.btn-close-white</code> variant that uses <code>filter: invert(1)</code> to enable higher contrast dismiss icons against darker backgrounds.</p>
</li>
</ul>
<h3id="collapse">Collapse <aclass="anchor-link"href="#collapse"aria-label="Link to this section: Collapse"></a></h3>
<ul>
<li>Removed scroll anchoring for accordions.</li>
</ul>
<h3id="dropdowns">Dropdowns <aclass="anchor-link"href="#dropdowns"aria-label="Link to this section: Dropdowns"></a></h3>
<ul>
<li>
<p>Added new <code>.dropdown-menu-dark</code> variant and associated variables for on-demand dark dropdowns.</p>
</li>
<li>
<p>Added new variable for <code>$dropdown-padding-x</code>.</p>
</li>
<li>
<p>Darkened the dropdown divider for improved contrast.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> All the events for the dropdown are now triggered on the dropdown toggle button and then bubbled up to the parent element.</p>
</li>
<li>
<p>Dropdown menus now have a <code>data-bs-popper="static"</code> attribute set when the positioning of the dropdown is static, or dropdown is in the navbar. This is added by our JavaScript and helps us use custom position styles without interfering with Popper’s positioning.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Dropped <code>flip</code> option for dropdown plugin in favor of native Popper configuration. You can now disable the flipping behavior by passing an empty array for <ahref="https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements"><code>fallbackPlacements</code></a> option in <ahref="https://popper.js.org/docs/v2/modifiers/flip/">flip</a> modifier.</p>
</li>
<li>
<p>Dropdown menus can now be clickable with a new <code>autoClose</code> option to handle the <ahref="/docs/5.2/components/dropdowns/#auto-close-behavior">auto close behavior</a>. You can use this option to accept the click inside or outside the dropdown menu to make it interactive.</p>
</li>
<li>
<p>Dropdowns now support <code>.dropdown-item</code>s wrapped in <code><li></code>s.</p>
</li>
</ul>
<h3id="jumbotron">Jumbotron <aclass="anchor-link"href="#jumbotron"aria-label="Link to this section: Jumbotron"></a></h3>
<ul>
<li><spanclass="badge bg-danger">Breaking</span> Dropped the jumbotron component as it can be replicated with utilities. <ahref="/docs/5.2/examples/jumbotron/">See our new Jumbotron example for a demo.</a></li>
</ul>
<h3id="list-group">List group <aclass="anchor-link"href="#list-group"aria-label="Link to this section: List group"></a></h3>
<ul>
<li>Added new <ahref="/docs/5.2/components/list-group/#numbered"><code>.list-group-numbered</code> modifier</a> to list groups.</li>
</ul>
<h3id="navs-and-tabs">Navs and tabs <aclass="anchor-link"href="#navs-and-tabs"aria-label="Link to this section: Navs and tabs"></a></h3>
<ul>
<li>Added new <code>null</code> variables for <code>font-size</code>, <code>font-weight</code>, <code>color</code>, and <code>:hover</code><code>color</code> to the <code>.nav-link</code> class.</li>
</ul>
<h3id="navbars">Navbars <aclass="anchor-link"href="#navbars"aria-label="Link to this section: Navbars"></a></h3>
<ul>
<li><spanclass="badge bg-danger">Breaking</span> Navbars now require a container within (to drastically simplify spacing requirements and CSS required).</li>
</ul>
<h3id="offcanvas">Offcanvas <aclass="anchor-link"href="#offcanvas"aria-label="Link to this section: Offcanvas"></a></h3>
<ul>
<li>Added the new <ahref="/docs/5.2/components/offcanvas/">offcanvas component</a>.</li>
</ul>
<h3id="pagination">Pagination <aclass="anchor-link"href="#pagination"aria-label="Link to this section: Pagination"></a></h3>
<ul>
<li>
<p>Pagination links now have customizable <code>margin-left</code> that are dynamically rounded on all corners when separated from one another.</p>
</li>
<li>
<p>Added <code>transition</code>s to pagination links.</p>
</li>
</ul>
<h3id="popovers">Popovers <aclass="anchor-link"href="#popovers"aria-label="Link to this section: Popovers"></a></h3>
<ul>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Renamed <code>.arrow</code> to <code>.popover-arrow</code> in our default popover template.</p>
</li>
<li>
<p>Renamed <code>whiteList</code> option to <code>allowList</code>.</p>
</li>
</ul>
<h3id="spinners">Spinners <aclass="anchor-link"href="#spinners"aria-label="Link to this section: Spinners"></a></h3>
<ul>
<li>
<p>Spinners now honor <code>prefers-reduced-motion: reduce</code> by slowing down animations. <ahref="https://github.com/twbs/bootstrap/pull/31882">See #31882</a>.</p>
</li>
<li>
<p>Improved spinner vertical alignment.</p>
</li>
</ul>
<h3id="toasts">Toasts <aclass="anchor-link"href="#toasts"aria-label="Link to this section: Toasts"></a></h3>
<ul>
<li>
<p>Toasts can now be <ahref="/docs/5.2/components/toasts/#placement">positioned</a> in a <code>.toast-container</code> with the help of <ahref="/docs/5.2/utilities/position/">positioning utilities</a>.</p>
</li>
<li>
<p>Changed default toast duration to 5 seconds.</p>
</li>
<li>
<p>Removed <code>overflow: hidden</code> from toasts and replaced with proper <code>border-radius</code>s with <code>calc()</code> functions.</p>
</li>
</ul>
<h3id="tooltips">Tooltips <aclass="anchor-link"href="#tooltips"aria-label="Link to this section: Tooltips"></a></h3>
<ul>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Renamed <code>.arrow</code> to <code>.tooltip-arrow</code> in our default tooltip template.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> The default value for the <code>fallbackPlacements</code> is changed to <code>['top', 'right', 'bottom', 'left']</code> for better placement of popper elements.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Renamed <code>whiteList</code> option to <code>allowList</code>.</p>
</li>
</ul>
<h2id="utilities">Utilities <aclass="anchor-link"href="#utilities"aria-label="Link to this section: Utilities"></a></h2>
<ul>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Renamed several utilities to use logical property names instead of directional names with the addition of RTL support:</p>
<ul>
<li>Renamed <code>.left-*</code> and <code>.right-*</code> to <code>.start-*</code> and <code>.end-*</code>.</li>
<li>Renamed <code>.float-left</code> and <code>.float-right</code> to <code>.float-start</code> and <code>.float-end</code>.</li>
<li>Renamed <code>.border-left</code> and <code>.border-right</code> to <code>.border-start</code> and <code>.border-end</code>.</li>
<li>Renamed <code>.rounded-left</code> and <code>.rounded-right</code> to <code>.rounded-start</code> and <code>.rounded-end</code>.</li>
<li>Renamed <code>.ml-*</code> and <code>.mr-*</code> to <code>.ms-*</code> and <code>.me-*</code>.</li>
<li>Renamed <code>.pl-*</code> and <code>.pr-*</code> to <code>.ps-*</code> and <code>.pe-*</code>.</li>
<li>Renamed <code>.text-left</code> and <code>.text-right</code> to <code>.text-start</code> and <code>.text-end</code>.</li>
</ul>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Disabled negative margins by default.</p>
</li>
<li>
<p>Added new <code>.bg-body</code> class for quickly setting the <code><body></code>’s background to additional elements.</p>
</li>
<li>
<p>Added new <ahref="/docs/5.2/utilities/position/#arrange-elements">position utilities</a> for <code>top</code>, <code>right</code>, <code>bottom</code>, and <code>left</code>. Values include <code>0</code>, <code>50%</code>, and <code>100%</code> for each property.</p>
</li>
<li>
<p>Added new <code>.translate-middle-x</code>&<code>.translate-middle-y</code> utilities to horizontally or vertically center absolute/fixed positioned elements.</p>
</li>
<li>
<p>Added new <ahref="/docs/5.2/utilities/borders/#border-width"><code>border-width</code> utilities</a>.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Renamed <code>.text-monospace</code> to <code>.font-monospace</code>.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Removed <code>.text-hide</code> as it’s an antiquated method for hiding text that shouldn’t be used anymore.</p>
</li>
<li>
<p>Added <code>.fs-*</code> utilities for <code>font-size</code> utilities (with RFS enabled). These use the same scale as HTML’s default headings (1-6, large to small), and can be modified via Sass map.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Renamed <code>.font-weight-*</code> utilities as <code>.fw-*</code> for brevity and consistency.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Renamed <code>.font-style-*</code> utilities as <code>.fst-*</code> for brevity and consistency.</p>
</li>
<li>
<p>Added <code>.d-grid</code> to display utilities and new <code>gap</code> utilities (<code>.gap</code>) for CSS Grid and flexbox layouts.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Removed <code>.rounded-sm</code> and <code>rounded-lg</code>, and introduced a new scale of classes, <code>.rounded-0</code> to <code>.rounded-3</code>. <ahref="https://github.com/twbs/bootstrap/pull/31687">See #31687</a>.</p>
</li>
<li>
<p>Added new <code>line-height</code> utilities: <code>.lh-1</code>, <code>.lh-sm</code>, <code>.lh-base</code> and <code>.lh-lg</code>. See <ahref="/docs/5.2/utilities/text/#line-height">here</a>.</p>
</li>
<li>
<p>Moved the <code>.d-none</code> utility in our CSS to give it more weight over other display utilities.</p>
</li>
<li>
<p>Extended the <code>.visually-hidden-focusable</code> helper to also work on containers, using <code>:focus-within</code>.</p>
</li>
</ul>
<h2id="helpers">Helpers <aclass="anchor-link"href="#helpers"aria-label="Link to this section: Helpers"></a></h2>
<ul>
<li>
<p><spanclass="badge bg-danger">Breaking</span><strong>Responsive embed helpers have been renamed to <ahref="/docs/5.2/helpers/ratio/">ratio helpers</a></strong> with new class names and improved behaviors, as well as a helpful CSS variable.</p>
<ul>
<li>Classes have been renamed to change <code>by</code> to <code>x</code> in the aspect ratio. For example, <code>.ratio-16by9</code> is now <code>.ratio-16x9</code>.</li>
<li>We’ve dropped the <code>.embed-responsive-item</code> and element group selector in favor of a simpler <code>.ratio > *</code> selector. No more class is needed, and the ratio helper now works with any HTML element.</li>
<li>The <code>$embed-responsive-aspect-ratios</code> Sass map has been renamed to <code>$aspect-ratios</code> and its values have been simplified to include the class name and the percentage as the <code>key: value</code> pair.</li>
<li>CSS variables are now generated and included for each value in the Sass map. Modify the <code>--bs-aspect-ratio</code> variable on the <code>.ratio</code> to create any <ahref="/docs/5.2/helpers/ratio/#custom-ratios">custom aspect ratio</a>.</li>
</ul>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span><strong>“Screen reader” classes are now <ahref="/docs/5.2/helpers/visually-hidden/">“visually hidden” classes</a>.</strong></p>
<ul>
<li>Changed the Sass file from <code>scss/helpers/_screenreaders.scss</code> to <code>scss/helpers/_visually-hidden.scss</code></li>
<li>Renamed <code>.sr-only</code> and <code>.sr-only-focusable</code> to <code>.visually-hidden</code> and <code>.visually-hidden-focusable</code></li>
<li>Renamed <code>sr-only()</code> and <code>sr-only-focusable()</code> mixins to <code>visually-hidden()</code> and <code>visually-hidden-focusable()</code>.</li>
</ul>
</li>
<li>
<p><code>bootstrap-utilities.css</code> now also includes our helpers. Helpers don’t need to be imported in custom builds anymore.</p>
</li>
</ul>
<h2id="javascript">JavaScript <aclass="anchor-link"href="#javascript"aria-label="Link to this section: JavaScript"></a></h2>
<ul>
<li>
<p><strong>Dropped jQuery dependency</strong> and rewrote plugins to be in regular JavaScript.</p>
</li>
<li>
<p><spanclass="badge bg-danger">Breaking</span> Data attributes for all JavaScript plugins are now namespaced to help distinguish Bootstrap functionality from third parties and your own code. For example, we use <code>data-bs-toggle</code> instead of <code>data-toggle</code>.</p>
</li>
<li>
<p><strong>All plugins can now accept a CSS selector as the first argument.</strong> You can either pass a DOM element or any valid CSS selector to create a new instance of the plugin:</p>
<p><code>popperConfig</code> can be passed as a function that accepts the Bootstrap’s default Popper config as an argument, so that you can merge this default configuration in your way. <strong>Applies to dropdowns, popovers, and tooltips.</strong></p>
</li>
<li>
<p>The default value for the <code>fallbackPlacements</code> is changed to <code>['top', 'right', 'bottom', 'left']</code> for better placement of Popper elements. <strong>Applies to dropdowns, popovers, and tooltips.</strong></p>
</li>
<li>
<p>Removed underscore from public static methods like <code>_getInstance()</code> → <code>getInstance()</code>.</p>
<liclass="mb-2">Designed and built with all the love in the world by the <ahref="/docs/5.2/about/team/">Bootstrap team</a> with the help of <ahref="https://github.com/twbs/bootstrap/graphs/contributors">our contributors</a>.</li>
<liclass="mb-2">Code licensed <ahref="https://github.com/twbs/bootstrap/blob/main/LICENSE"target="_blank"rel="license noopener">MIT</a>, docs <ahref="https://creativecommons.org/licenses/by/3.0/"target="_blank"rel="license noopener">CC BY 3.0</a>.</li>