Bootstrap responsive sidebar menu to top navbar

Bootstrap 5 (update 2021) Some of the classed have change for Bootstrap 5, but the concept is still the same. Here’s an updated Bootstrap 5 sidebar to navbar example Bootstrap 4 (original answer) It could be done in Bootstrap 4 using the responsive grid columns. One column for the sidebar and one for the main … Read more

How to create scrollable element in Tailwind without a scrollbar

To hide the scrollbar you’ll need to style it directly: /* Hide scrollbar for Chrome, Safari and Opera */ .no-scrollbar::-webkit-scrollbar { display: none; } /* Hide scrollbar for IE, Edge and Firefox */ .no-scrollbar { -ms-overflow-style: none; /* IE and Edge */ scrollbar-width: none; /* Firefox */ } You could easily add these as Tailwind … Read more

Navbar dropdown (collapse) is not working in Bootstrap 5

The data-* attributes used in Bootstrap 4 have been replaced with data-bs-* in Bootstrap 5 <button class=”navbar-toggler” data-bs-toggle=”collapse” data-bs-target=”#navbar”> <span class=”navbar-toggler-icon”></span> </button> Demo As explained in the docs, data attributes for all JavaScript plugins are now namespaced to help distinguish Bootstrap functionality from third parties and your own code. This means any javascript components (Collapse, … Read more

Bootstrap 5 – Uncaught TypeError: Popper__namespace.createPopper is not a function

I received this error (TypeError: i.createPopper is not a function) each time when popovers should be shown. Previously I had to make use of the Separate Popper and Bootstrap JS (Option 2) – due to conflict with other scrips. However this is no longer necessary in my project, with Bootstrap 5.1.1. Including only the Bootstrap … Read more

Changing Dropdown Icon on Bootstrap

Bootstrap 5 (update 2023) Changing the dropdown caret to an icon still works the same way in Bootstrap 5. Don’t forget to change the data-toggle to data-bs-toggle: <div class=”dropdown”> <button class=”btn btn-secondary” type=”button” id=”dropdownMenuButton” data-bs-toggle=”dropdown” aria-haspopup=”true” aria-expanded=”false”> Dropdown button <i class=”fa fa-heart”></i> </button> <div class=”dropdown-menu” aria-labelledby=”dropdownMenuButton”> <a class=”dropdown-item” href=”#”>Action</a> <a class=”dropdown-item” href=”#”>Another action</a> <a class=”dropdown-item” … Read more

Bootstrap V5 manually call a modal myModal.show() not working (vanilla javascript)

The modal plugin toggles your hidden content on demand, via data attributes or JavaScript. It also adds .modal-open to the to override default scrolling behavior and generates a .modal-backdrop to provide a click area for dismissing shown modals when clicking outside the modal. [source] How to use via Vanilla JavaScript Create a modal with a … Read more

Bootstrap 5 form-group, form-row, form-inline not working

The reason is form-group, form-row, and form-inline classes have been removed in Bootstrap 5: Breaking change: Dropped form-specific layout classes for our grid system. Use our grid and utilities instead of .form-group, .form-row, or .form-inline. https://getbootstrap.com/docs/5.0/migration/#forms So Grid and Utilities are supposed to be used instead. …but if you are looking for a quick solution, … Read more

Using media breakpoints in Bootstrap 4-alpha

Update: Bootstrap 5. v5 breakpoints reference Original answer – Bootstrap v4: Use breakpoint mixins like this: .something { padding: 5px; @include media-breakpoint-up(sm) { padding: 20px; } @include media-breakpoint-up(md) { padding: 40px; } } v4 breakpoints reference v4 alpha6 breakpoints reference Below full options and values. Breakpoint & up (toggle on value and above): @include media-breakpoint-up(xs) … Read more

Bootstrap 3 & Boostrap 4 & Bootstrap 5 – input-xs (smaller than sm)

For inputs smallers: .input-xs { height: 22px; padding: 2px 5px; font-size: 12px; line-height: 1.5; /* If Placeholder of the input is moved up, rem/modify this. */ border-radius: 3px; } Sample usage in input-group: <div class=”input-group”> <span class=”input-group-btn”> <button class=”btn btn-xs btn-success”> <i class=”glyphicon glyphicon-plus”></i> </button> </span> <input type=”text” class=”form-control input-xs” /> <span class=”input-group-btn”> <button class=”btn … Read more