Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Bootstrap Laravel Package

twbs/bootstrap

Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development. It ships with prebuilt CSS and JS, Sass sources, and icons for building responsive, mobile-first sites.

View on GitHub
Deep Wiki
Context7

Getting Started

Heads-up: the latest tag is v6.0.0-alpha.1 — a pre-release with no published release notes. Do not treat it as a drop-in upgrade. For day-to-day Laravel work, stay pinned to the stable line:

composer require twbs/bootstrap:^5.3.8

Only pull the alpha into a throwaway branch when you explicitly want to evaluate v6:

composer require twbs/bootstrap:v6.0.0-alpha.1

Note that Composer will not resolve ^6.0 to a pre-release unless you lower the minimum-stability or add an explicit constraint — which is a useful safety net.

For the stable 5.3.x workflow (unchanged): the package ships compiled CSS/JS plus source SCSS. Import the SCSS in resources/css/app.css (@import 'bootstrap/scss/bootstrap';) and compile with Vite. First use case: add a Bootstrap container and grid classes to a Blade template (<div class="container">...</div>) and confirm the compiled stylesheet loads.

Because no changelog accompanies v6.0.0-alpha.1, treat the v6 surface as undocumented for now — check the repo's v6-dev branch, migration guide, and dist tags directly before relying on anything.


Implementation Patterns

  • Two-track dependency strategy: keep ^5.3.8 on main for anything shipping to production, and add a separate branch/composer constraint for v6.0.0-alpha.1 spike work. This avoids accidentally inheriting alpha breaking changes in feature branches.
  • Component-driven templating (5.3.x): paste Bootstrap component markup from the official docs into Blade views. For interactive components, drive them with Alpine rather than Bootstrap's JS where you already have Alpine in the stack:
    <div x-data="{ open: false }" @click.away="open = false">
      <button @click="open = true">Toggle Modal</button>
      <div x-show="open" style="display: none;" @click.stop>
        <div class="modal" style="display: block;">
          <!-- Modal content -->
        </div>
      </div>
    </div>
    
  • Theme customization via SCSS variables: define overrides before importing Bootstrap, and use the 5.3.x contrast helpers:
    $primary: #0d6efd;
    $primary-rgb: rgb_var($primary);
    $primary-contrast: color-contrast($primary-rgb);
    
  • Selective JS imports: import only the modules you use to keep bundle size down:
    import { Modal, Tooltip } from 'bootstrap';
    
  • Livewire/Alpine bridging: instantiate Bootstrap components from Livewire events rather than mixing lifecycle ownership:
    $wire.on('modal.show', (id) => new bootstrap.Modal(`#${id}`).show());
    
  • Alpha evaluation checklist (do this on the spike branch, not production): compile the Vite pipeline against the alpha's SCSS entry point, grep your views for every data-bs-* attribute and utility class you depend on, and smoke-test each interactive component. Record findings in a migration note so the eventual stable upgrade is mechanical.

Implementation Patterns (v6 alpha — verify before use)

The alpha has no release notes, so the only reliable way to learn the delta is to diff the published package against 5.3.x locally:

diff -r vendor/twbs/bootstrap/scss /path/to/bootstrap-5.3.8/scss | less

Treat everything you find as provisional until a stable v6 changelog exists.


Gotchas and Tips

  • No release notes = no assumptions. v6.0.0-alpha.1 was published without a changelog body. Do not assume which SCSS variables, JS data attributes, or utility classes changed. Assume something did, since this is a major bump.
  • alpha stability in CI: if you add the alpha anywhere, pin the exact version (v6.0.0-alpha.1), not a range. Alpha-to-alpha bumps routinely break builds.
  • SCSS import order still matters: define custom variables before @import 'bootstrap/scss/bootstrap';. In 5.3.x, color-contrast() requires RGB values (e.g., rgb_var($primary)) — re-verify this signature in v6 rather than copying it forward.
  • Popper: Bootstrap 5+ bundles Popper internally — avoid separate @popperjs/core installs unless you're doing a custom build. Confirm this still holds in v6.
  • Minified vs. source: use dist/css/bootstrap.min.css in production and scss/ for customization. Note that v5.3.8's downloadable examples ship unminified dist/ files.
  • CSP & nonce compatibility: Bootstrap's JS historically used eval() in fallbacks. If you run a strict CSP, verify your build and whitelist 'unsafe-eval' only as a last resort.
  • 5.3.8 fixes worth keeping on your radar (still relevant while you're on the stable line): spinner distortion in flex containers with multiline content (PR #41654), and the reverted dropdown focus regression from v5.3.7 (PR #41668) — no action needed unless you relied on the broken behavior.
  • Themes removal: Bootstrap's docs no longer ship themes (PR #41671). For custom themes, use the SCSS variables system.
  • Upgrade discipline: when v6 reaches beta/stable and publishes notes, re-read this assessment before bumping. Until then, treat v6.0.0-alpha.1 as an experiment, not a release.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
vento/laravel-airbrake
wfeller/laravel-batch
maco-studios/mage-os-installer
busarm/armie
siberfx/laravel-logger
kfteam1991/dcat-admin
dashed/dashed-laposta
dashed/dashed-ecommerce-montaportal
dashed/dashed-ecommerce-etsy
neohq/string-blade-compiler
log1x/acf-composer
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager