The Bootstrap Blog

News and announcements for all things Bootstrap, including new releases, Bootstrap Themes, and Bootstrap Icons.

Bootstrap 5

@mdo May 05, 2021

Bootstrap 5 has officially landed! After three alphas, three betas, and several months of hard work, we’re shipping the first stable release of our new major version. It’s been a wild ride made possible by our maintainers and the amazing community that uses and contributes to Bootstrap. Thanks to all who have helped us get here!

Keep reading for details on what’s new compared to v4 and what’s coming for subsequent releases. Want to get right to it? Head to the new v5 docs or fly by the seat of your pants and just npm i bootstrap.


In this post:


New Bootstrap logo

One of the biggest changes with v5 came with our redesigned logo and updated docs design. Inspired by the work we’ve done in Bootstrap Icons, our new logo is a callback to CSS’s curly braces and our longstanding B icon. It’s a small upgrade, but a fun one nonetheless, and one that we feel helps set the tone for this new major release. Still the same Bootstrap, just slightly refined. 😅

New Bootstrap docs layout

And the new docs are brighter, better organized with new content sections, and also feature improved navigation.

New offcanvas component

One of our big new component additions is the all-new offcanvas!

Offcanvas example

Built on and sharing fundamental pieces of our modals, our new offcanvas component comes with a configurable backdrop, body scroll, and placement. Offcanvas components can be placed on the top, right, bottom, or left of the viewport. Configure these options with data attributes or via the JavaScript APIs.

New accordion

We’ve replaced our .card accordion component with a brand new .accordion component, solving several bugs in the process. Our new accordion still uses the Collapse JavaScript plugin, but with custom HTML and CSS to support it, it’s better and easier than ever to use.

New Bootstrap accordion

The new accordion includes Bootstrap Icons as chevron icons indicating state and click-ability. We’ve included support for a flush accordion (add .accordion-flush) to remove the outer borders, allowing for easier placement inside parent elements.

Visit the new docs page to learn more.

New and updated forms

We’ve overhauled our Forms documentation and components. We’ve consolidated all our forms styles into a new Forms section (including the input group component) to give them the emphasis they deserve.

New Bootstrap 5 forms docs

Alongside new docs pages, we’ve redesigned and de-duped all our form controls. In v4 we introduced an extensive suite of custom form controls—checks, radios, switches, files, and more—but those were in addition to whatever defaults each browser provided. With v5, we’ve gone fully custom.

Checks and radios

New Bootstrap 5 checks

If you’re familiar with v4’s form markup, this shouldn’t look too far off for you. With a single set of form controls and a focus on redesigning existing elements vs generating new ones via pseudo-elements, we have a much more consistent look and feel.

<div class="form-check">
  <input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
  <label class="form-check-label" for="flexCheckDefault">
    Default checkbox
  </label>
</div>

<div class="form-check">
  <input class="form-check-input" type="radio" name="flexRadioDefault" id="flexRadioDefault1">
  <label class="form-check-label" for="flexRadioDefault1">
    Default radio
  </label>
</div>

<div class="form-check form-switch">
  <input class="form-check-input" type="checkbox" id="flexSwitchCheckDefault">
  <label class="form-check-label" for="flexSwitchCheckDefault">Default switch checkbox input</label>
</div>

Every checkbox, radio, select, file, range, and more includes a custom appearance to unify the style and behavior of form controls across OS and browser. These new form controls are all built on completely semantic, standard form controls—no more superfluous markup, just form controls and labels.

Floating labels

New floating labels

Floating labels include support for textual inputs, selects, and textareas. We have one limitation with textareas where multiple lines of text can be obscured by the floating label. We’re working on fixes for this, so if you have ideas, please let us know!

New file input

New file input

We’ve dropped our custom .form-file class for additional styles on the .form-control class. This means we no longer require additional JavaScript to make our file input styles functional—the new form file is all CSS!

Simplified layout

Using our new grid updates, form layout has never been easier. We’ve dropped the .form-group, .form-row, and .form-inline for the grid system.

New form layout via grid

Be sure to explore the new forms docs and let us know what you think.

RTL is here!

Bootstrap RTL docs

We’ve finally added RTL support to Bootstrap! At a high level, our RTL approach includes a handful of changes:

Our approach is built on RTLCSS, an awesome project that helps reprocess an existing LTR stylesheet for RTL. We’ve classified it as an experimental feature for now, anticipating that we’ll get some of this wrong. We’re looking to the community to help us round out the feature as we wrap up some remaining todos.

Overhauled utilities

Given the love utility-driven frameworks have garnered the last few years, we’ve invested in adding more utilities to Bootstrap along with a new method of managing them across your projects.

New utilities API

We’ve implemented a brand new utility API into Bootstrap 5 as the primary way to extend Bootstrap’s default utility classes. Easily generate and customize utilities with support for custom class names, support for generating state-based classes like :hover, print versions, and more.

$utilities: () !default;
$utilities: map-merge(
  (
    // ...
    "margin": (
      responsive: true,
      property: margin,
      class: m,
      values: map-merge($spacers, (auto: auto))
    ),
    // ...
    "opacity": (
      property: o,
      class: opacity,
      state: hover,
      values: (
        0: 0,
        25: .25,
        50: .5,
        75: .75,
        100: 1,
      )
    )
    // ...
  ), $utilities);

Ever since utilities become a preferred way to build, we’ve been working to find the right balance to implement them in Bootstrap while providing control and customization. In v4, we did this with global $enable-* classes, and we’ve even carried that forward in v5. But with an API-based approach, we’ve created a language and syntax in Sass to create your own utilities on the fly while also being able to modify or remove those we provide.

Head to the new Utilities API docs to learn more.

New utilities

Speaking of utilities, we’ve added a ton of new ones to our arsenal, including:

  • Added positioning utilities: top, right, bottom, and left with 0, 50%, and 100% values
  • Added .d-grid option, along with new gap utilities for easy grid layouts
  • Added .fs utilities for font-size
  • Renamed font-weight utilities to .fw
  • Added .rounded-1, .rounded-2, and .rounded-3 for new small, medium, and large border-radius utilities
  • Added .overflow-visible and .overflow-scroll utilities

Check out the Migration guide and utilities documentation for more details.

Logical properties for spacing utilities

Part of our approach to adding RTL to Bootstrap was to add it in a way that felt future-friendly to ourselves and the web at large. As such, we’ve embraced the spirit of CSS logical properties and have renamed several classes and variables. It’s a risky change because of the size and impact of the change, but we hope you’ll appreciate it overall!

Most of you have already interacted with logical properties thanks to our flex utilities—they replace direction properties like left and right in favor start and end. Things like align-items-end have been welcomed additions. This makes horizontal directional class names appropriate for LTR and RTL without any additional overhead moving forward.

For example, in a LTR context, instead of .ml-3 for margin-left, use .ms-3. Be sure to read the RTL Migration guide for a full list of renamed classes and variables.

New snippet examples

New examples

We’ve added four brand new snippet-heavy examples and refreshed a few other examples while we were at it. These new snippet examples feature several variations of common components, served up in different ways for you to easily copy and paste.

These new snippets will continue to grow with new additions over time, showing just how fun and easy it is to build with Bootstrap.

New starter example

We’ve also updated our starter template with a refreshed design and more resources.

Grid and layout

Our grid system and layout options saw some changes to streamline and improve things, namely:

  • Column classes can now be used as width utilities (e.g., .col-6 is width: 50%) as padding is no longer applied outside a .row.
  • New gutter utilities can responsively customize horizontal and vertical grid gutters. The gutter width has also been reduced to 1.5rem.
  • Removed position: relative from column classes
  • Dropped the .media component for utilities

We also updated our layout documentation to break apart the exceptionally long pages into more focused topics. We’ve also added a clarified explanation of breakpoints, containers, and more.

Check out the Migration guide and layout documentation for more details.

More component updates

Across the board we’ve made a number of other enhancements and changes to key components:

  • We’ve overhauled the JavaScript and positioning for our dropdowns as part of our adoption of Popper 2. You can see all the options in a new example in our docs and new CSS selectors and data attributes used to position them.
  • Dropdown menus now have a new .dropdown-menu-dark modifier class.
  • Similarly, carousels now have a new .carousel-dark modifier class to invert the controls, text, and indicators.
  • Added icon examples to our Alert component for adding Bootstrap Icons (or other icon libraries) using utilities
  • Our close button has been redesigned with an SVG background-image and improved cross-browser styling.
  • We’ve dropped the .btn-block class for utilities.
  • We’ve updated navbars with a new .navbar-nav-scroll for vertical max-height and scrolling of when a collapsed navbar is opened
  • List groups have a new .list-group-numbered modifier class that uses pseudo-elements to create numbered list group items.

Improved customizing

We’ve hunkered down and improved our documentation in several places, giving more explanation, removing ambiguity, and providing much more support for extending Bootstrap. It all starts with a whole new Customize section.

Bootstrap 5 customize docs

v5’s Customize docs expand on v4’s Theming page with more content and code snippets for building on top of Bootstrap’s source Sass files. We’ve fleshed out more content here and even provided a starter npm project for you to get started with faster and easier. It’s also available as a template repo on GitHub, so you can freely fork and go.

Bootstrap 5 color palette

We’ve expanded our color palette in v5, too. With an extensive color system built-in, you can more easily customize the look and feel of your app without ever leaving the codebase. We’ve also done some work to improve color contrast, and even provided color contrast metrics in our Color docs. Hopefully, this will continue to help make Bootstrap-powered sites more accessible to folks all over.

New Sass docs

We’ve also added new sections to most of our pages to document the source Sass code that powers each component. Variables, mixins, loops, and maps are all rendered and kept up to date in each page, making it easier to reference and customize values as you build.

Dart Sass

We’ve switched to Dart Sass with LibSass being deprecated. We’ve been testing our builds with Dart Sass for a while and decided to make the switch with LibSass being deprecated just a couple of weeks ago. We’re holding on to the Sass modules for now. We’re still not using the new module system for compatibility concerns and a greater gap for folks upgrading from v4.

Browser support

We’ve dropped a ton of older browsers in this update, making it one of our biggest leaps in a while:

  • Dropped Microsoft Edge Legacy
  • Dropped Internet Explorer 10 and 11
  • Dropped Firefox < 60
  • Dropped Safari < 10
  • Dropped iOS Safari < 10
  • Dropped Chrome < 60
  • Dropped Android < 6

You can find the full browser and device support in our .browserslistrc.

JavaScript

The biggest change to our JavaScript has been the removal of jQuery, but we’ve also made a number of enhancements beyond that as well.

  • No more jQuery!
  • All plugins can now accept a CSS selector as the first argument.
  • Updated to Popper 2!
  • Data attributes for all JavaScript plugins are now namespaced with bs. For example, we use data-bs-toggle instead of data-toggle.
  • We overhauled dropdown, popover, and tooltip placement with the arrival of Popper v2.
  • Toast positioning was also overhauled and now leverages our new position utilities.
  • Added ability to use custom classes for tooltips and popovers.
  • Made various optimizations to better share code across components.
  • Changed dropdowns to emit events on .dropdown-toggle instead of .dropdown.
  • Removed underscore from public static methods like _getInstance() to getInstance().
  • Renamed whiteList to allowList in popovers and tooltips`

Migration guide

We’ve updated our migration guide page to consolidate all our changes across the six pre-releases into a single set of changes. We’ve condensed much of the content this way and added Breaking change labels throughout to help draw you attention to potential gotchas while upgrading.

We still think there’s more to do here—including tutorial-like guidance on the code changes, diffs and code snippets for our dependencies, etc. If you have suggestions or want to contribute, please open an issue or pull request.


Head to GitHub for a complete list of issues and pull requests in v5.0.0. You can also review the v5.0.0 project board, too.

Get the release

Head to https://getbootstrap.com to explore the new release. We’ve also published this updated as our new latest release on npm, so if you’re feeling bold or are curious about what’s new, you can pull the latest in that way.

npm i bootstrap

Review the GitHub v5.0.0 release changelog for a complete list of changes since our last pre-release.

What’s next

Looking ahead, we’re eyeing our first stable release for Bootstrap 5! But we also have some other releases on the horizon:

Feel free to open issues or pull requests if you have any additional ideas for upcoming releases!

v5.1.0 preview

While we were polishing up this release, we also had our eyes towards the future to ship a few minor releases. Here’s a quick look at what’s coming in our next minor release, v5.1.0:

And more features and updates are planned for a few more releases after that! Check out our projects on GitHub for a closer look.

Support the team

Visit our Open Collective page or our team members’ GitHub profiles to help support the maintainers contributing to Bootstrap.

Bootstrap Icons v1.4.1

@mdo March 29, 2021

Our latest Bootstrap Icons update has arrived to fix a few bugs and improve our build tooling. Keep reading for what’s new.

Key changes

Here are the highlights from this release:

  • Updated: PowerPoint icons now look more capitalized
  • Fixed: skip-forward and skip-backward icons are now properly named
  • Fixed: mic and record icons no longer appear filled
  • Fixed: Codepoints for icon font will no longer change between versions
  • Upgraded SVGO to v2.3.0, bringing some minor SVG optimizations to ~200 icons

The update to codepoints is the most important change in this release. It ensures the content property values for each icon doesn’t change. This gives our icon font more stability between versions, allowing for easier upgrades and maintenance.

Check out the release notes for more changes in v1.4.1.

Install

To get started, install via npm:

npm i bootstrap-icons

You can also download the release from GitHub, or download just the SVGs and fonts (without the rest of the repository files).

Figma

For the Figma users out there, you can also snag the icons from Figma.

Bootstrap 5 Beta 3

@mdo March 23, 2021

Our final beta for Bootstrap 5 has come with some amazing new changes (including a new component!), documentation updates, and more. We’ve also fixed some important bugs since our last release, in particular with our dependencies. Next up is our stable release!

Keep reading for a recap of what’s new in Beta 3.

New offcanvas component

Offcanvas example

Thanks to our newest team member, @GeoSot, we have a brand new component to unveil in Beta 3—introducing offcanvas! Built on and sharing fundamental pieces of our modals, the offcanvas comes with configurable backdrop, body scroll, and placement. Offcanvas components can be placed on the left, right, and bottom of the viewport. Configure these options with data attributes or via the JavaScript APIs.

We’re excited about iterating on the new offcanvas component and building additional examples and demos with you. Please share any feedback on an issue or pull request as you start to use it in your projects.

New and refreshed examples

New examples

Our examples have been updated in Beta 3 as well. We’ve added four brand new snippet-heavy examples and refreshed a few others. New with this release are several snippets for headers, heroes, features, and sidebars. These new snippets will continue to grow with new additions over time, showing just how fun and easy it is to build with Bootstrap.

New starter example

We’ve also updated our starter template with a refreshed, simplified design and more resource links. We’ll also incorporate this new look and feel into our npm starter project project, and eventually add a Parcel starter project.

Lastly, we’ve updated our pricing, checkout, and sign-in examples. We’ve also added a new jumbotron example to show you how to create your own jumbotron since we removed it in Bootstrap 5.

Improved Sass docs

New Sass docs

Since our last release, we’ve added a new section to nearly every component and utility documentation page for the source Sass code. Where appropriate, we now list Sass variables, maps, loops, and animation keyframes. These are directly linked from our source files, so whenever we ship new code, they’ll automatically be up-to-date.

And more!

Some highlights from the rest of our documentation updates and bugfixes include:

  • Added new .list-group-numbered variation to list groups that uses pseudo-elements for numbering list group items.
  • Removed explicit focus state suppression in Reboot
  • Improved carousel swipe behaviors for RTL
  • Updated accordions to improve transitions and borders when animating
  • Updated Sass customization docs to show how to properly override default variables
  • Fixed tooltips not appearing after rapid focus in and out
  • Fixed dropdown events not bubbling and forms inside dropdowns not propagating
  • Removed flip option from dropdowns
  • Disabled select now render consistently in Chrome
  • Button elements now grow in .nav-fill and .nav-justified
  • JavaScript plugin constructors now accept CSS selectors
  • De-duped the .border-0 utility
  • Fixed event handler removal in dropdown/carousel dispose
  • Added new Parcel guide to the docs
  • Added input focus blur Sass variable
  • Updated .browserslistrc to drop Android and add Safari/iOS 12 as the new minimum version (completing our two latest major releases guideline for supported browsers).

Head to GitHub for a complete list of issues and pull requests in v5 Beta 3. You can also review the v5 beta 3 project board, too.

A huge thanks to another new team member, @rohit2sharma95, for the dozens of pull requests, bug fixes, and code reviews for our JavaScript plugins.

Get the release

Head to https://getbootstrap.com to explore the new release. We’ve also published this updated as a pre-release to npm, so if you’re feeling bold or are curious about what’s new, you can pull the latest in that way.

npm i bootstrap@next

What’s next

Looking ahead, we’re eyeing our first stable release for Bootstrap 5! But we also have some other releases on the horizon:

As mentioned in our last release, after v5 goes stable, we’ll look to add some of the awesome features we’ve built up in our backlog. Check out the v5.1 project for an idea of what’s being planned. Feel free to open issues or pull requests if you have any additional ideas!

Support the team

Visit our Open Collective page or our team members’ GitHub profiles to help support the maintainers contributing to Bootstrap.

Bootstrap Icons v1.4.0

@mdo February 22, 2021

Bootstrap Icons v1.4.0 adds over 60 new icons as part of a brand new weather category. Also included are some long requested improvements to vertical alignment and a handful of updates to tags and categories.

Keep reading for a preview of the new icons and how icon alignment has changed.

60+ weather icons

New icons in v1.4.0

The new weather category includes over 60 icons for various weather and atmospheric conditions. From fog and haze to rainstorms and hurricanes, we now have icons for just about every weather situation. We undoubtedly have some more work to do to refine and add to this new category, but it’s a pretty big addition to the project. Let us know what you think and what’s missing so we can keep adding to it over time.

Alignment changes

Alignment changes

Also new in v1.4.0 are some alignment changes—before and after are shown above. Previously we used vertical-align: text-top in our CSS to aligning individual icons. This wasn’t as much of an issue when we only had SVGs, but with the addition of icon fonts and their generated CSS in v1.2.0, we had to make some changes.

New in this release is a change to vertical-align: -.125em. This new alignment is similar to that found in the tried and true Font Awesome project. This change essentially raises icons up about 1px to better vertically center them with nearby text.

It may not be perfect in all implementations, so additional changes might still be needed, but this should give you a stronger baseline to start (pun intended). Should you still run into issues, please don’t hesitate to open an issue on GitHub.

And more…

We’ve also made several updates under the hood, from dependencies to build tools. This has resulted in improved speeds for our development scripts and more resilient tooling for packaging our icons. We’ve also included category names into the fuzzy search on the homepage, making it a lot easier to search for groups of icons.

We still have some work to do on our docs and search, so stay tuned as we’ll eventually add category pages and more for easier browsing and navigating. If you’re reading this and want to help improve the Bootstrap Icons docs, please consider opening a PR anytime.

Install

To get started, install via npm:

npm i bootstrap-icons

You can also download the release from GitHub, or download just the SVGs and fonts (without the rest of the repository files).

Figma

For the Figma users out there, you can also snag the icons from Figma.

Bootstrap 5 Beta 2

@mdo February 10, 2021

Our second beta has arrived for Bootstrap 5! We delayed its release to iron out some issues with third-party libraries and stabilize our major changes. We’ve also once again shipped some awesome updates to our documentation.

Next up is our final beta, which we may even promote to a stable release depending on how development proceeds. Stay tuned for that!

Dropdown docs screenshot

Dropdowns saw a lot of work in Beta 2 because of how much has changed in both our JavaScript and in Popper.js (which we depend on for most dropdown, popover, and toolip positioning). We’ve modified our dropdown plugin to add a new data attribute to help separate our own positioning styles with that of Popper’s. The issues we saw—like a .dropstart menu overlapping a button or an incorrect responsive .dropdown-menu-end class—were largely the result of competing positioning.

Now when dropdown menus have data-bs-display="static", we’ll add data-bs-popper="static" via JavaScript to their associated .dropdown-menu. When dropdowns are in our navbars, their menus will have data-bs-popper="none" added. This separates two different positioning libraries, ours and Poppers, and ensures all behaviors are supported. You can see all the options in a new example in our docs. We updated our CSS selectors to use these new data attributes, too.

In addition, we’ve removed the initial margins from dropdowns and popovers, instead of relying on Popper’s offsets. These also conflicted with the default styling for elements positioned by Popper.js. Relatedly, there was a bug in how popover arrows were aligned that has now been resolved.

Color utility docs

Sass docs screenshot

We’ve overhauled our color utility documentation, separating the text color classes from our background-color ones. We’ve also made extensive use of our scss-docs shortcode to include tons more code snippets in our docs.

Both pages now include a new Sass section, showing relevant snippets of our source code that are related to each set of utilities. We list all our available color variables, our theme color variables and maps, associated mixins and loops, and even where these utilities are generated in the utilities API.

Expect this kind of documentation improvements to continue into our next release. Follow along in the draft pull request that adds Sass docs to all our components on GitHub.

JS updates

We’ve spent a significant amount of time in Beta 2 improving our JavaScript plugins to fix bugs and improve behaviors since dropping jQuery.

  • Dropdown now emits events on the .dropdown-toggle instead of the .dropdown.
  • Restored the offset option for dropdowns.
  • Fixed modal toggling when clicking on data-bs-toggle="modal".
  • We now build our base component as a separate .js file.
  • We now prevent getSelector from returning URLs as selector which caused errors in dropdown and scrollspy plugins.
  • Refactored components to use a utility function to define jQuery plugins

Miscellaneous updates

Across the board, we’ve made a few small changes to other components that are worth a brief mention here.

  • Navbars:
    • Added a new .navbar-nav-scroll class to enable vertical scrolling when a collapsed navbar is opened. It’s customizable via Sass and a CSS variable. Read more in the docs.
    • We’ve re-added flex-grow to the .navbar-collapse to restore the flexbox behaviors from v4 and prevent some content from being inadvertently squished.
  • Forms:
    • Removed vertical-align from .form-select
    • Form validation mixin updated with additional parameters
    • Fixed validation icon placement in .form-select
    • Checkboxes and radio buttons are aligned better in input groups
  • Buttons:
    • Added variables for tinting and shading button state colors
    • Suppressed the default focus outline for buttons in Chromium
  • Toasts:
    • Added word-break to .toast-body
    • Added a live example to the docs to trigger a real toast
  • Bundles:
    • Added our helpers to the utilities CSS bundle
  • Carousels:
    • Updated docs examples to use <button>s wherever possible instead of <a> elements.
    • CSS selectors changed for using <button>s as indicators (from .carousel-indicators li to .carousel-indicators [data-bs-target]).

For a more complete list of changes, check out the v5 Beta 2 project board or list of issues and PRs in this release.

Get started

Head to https://getbootstrap.com to explore the new release. We’ve also published this updated as a pre-release to npm, so if you’re feeling bold or are curious about what’s new, you can pull the latest in that way.

npm i bootstrap@next

What’s next

We have three releases coming up next for the team:

  • Bootstrap v5.0.0-beta3 (possibly promoted to v5 stable)
  • Bootstrap v4.6.1 (bringing in some more bugfixes and alignment with the latest in v5)
  • Bootstrap Icons v1.4.0

Our v5 Beta 3 will continue to focus on JavaScript issues and documentation improvements. Tooltips in particular need some attention after our fixes to dropdowns and popovers. After v5 goes stable, we’ll look to adding some of the awesome features we’ve built up in our backlog. Check out the v5.1 project for an idea of what’s being planned.

Support the team

Visit our Open Collective page or our team members’ GitHub profiles to help support the maintainers contributing to Bootstrap.