seyhunak/twitter-bootstrap-rails — an open-source project — sits at 4.5k GitHub stars. Twitter Bootstrap for Rails 8
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Integrates Bootstrap 5.3.8 into Rails Asset Pipeline. Supports Rails 8, 7, 6, 5.
Tested against Rails 8.1.4.1 and 8.0.5.2.
Upgrade Rails. Rails 8.1.4.1 and 8.0.5.2
fix 21 security issues, and the Rails team strongly recommends upgrading as soon
as possible. This gem's dependency range still allows older Rails versions, so
installing it won't upgrade Rails for you. Run bundle update rails in your app.
Security support for Rails 8.0 ends on 7 November 2026, and older series are
already unsupported.
Every code snippet on the
Bootstrap 5.3 Introduction page
is reproducible from a command:
Docs snippet
Command
Starter template
rails g bootstrap:starter
CDN CSS <link>
rails g bootstrap:cdn --css
CDN JS bundle <script>
rails g bootstrap:cdn --js
Popper + bootstrap.js separately
rails g bootstrap:cdn --separate-popper
Important globals (doctype, lang, viewport)
baked into every generated layout and the starter template
# Install Bootstrap assets into the asset pipeline
rails g bootstrap:install static
# ...or load Bootstrap from the jsDelivr CDN instead
rails g bootstrap:install cdn
# Generate a Bootstrap layout
rails g bootstrap:layout application
# ...linking Bootstrap from the CDN, with Subresource Integrity
rails g bootstrap:layout application --cdn
# ...using Popper and bootstrap.js separately rather than the bundle
rails g bootstrap:layout application --cdn --separate-popper
# Write the starter template from the Bootstrap docs
rails g bootstrap:starter # -> public/bootstrap-starter.html
rails g bootstrap:starter --path=public/demo.html
# Print CDN tags to paste into a layout you already own (writes nothing)
rails g bootstrap:cdn
# Generate themed views for scaffold
rails g scaffold Task title:string done:boolean
rails db:migrate
rails g bootstrap:themed Tasks
bootstrap:install cdn records the choice in config/initializers/bootstrap.rb,
so bootstrap:layout emits CDN tags by default afterwards. Pass --cdn or
--no-cdn to override it per run.
Both asset pipelines are supported. On Sprockets, static adds require
directives to your manifests. On Propshaft (the Rails 8 default) there are no
directives to add, so the generated layout links the vendored files directly —
run rails g bootstrap:layout after bootstrap:install static either way.
The Bootstrap version and its CDN URLs and integrity hashes live in one place,
Twitter::Bootstrap::Rails::BOOTSTRAP_CDN. No template hardcodes them.
Snippets
Every snippet published at
getbootstrap.com/docs/5.3/examples
— 62 of them across 12 categories — is a command. Each writes an .html.erb
partial into app/views/shared/:
rails g bootstrap:header # the first variant, "centered"
rails g bootstrap:header dark_search # a specific variant
rails g bootstrap:header --list # what's available, with descriptions
Variants are listed in the order they appear on the docs page, so the first one
in each row is the first example Bootstrap shows.
Options, on every snippet command:
Option
Effect
--list
Print the variants with descriptions and exit, writing nothing
--json
Print the variants as JSON and exit, writing nothing
--as=NAME
Partial name to write (default: the generator name)
--path=DIR
Where to write it (default: app/views/shared)
--no-icons
Skip installing the shared icon sprite
rails g bootstrap:footer columns --as=site_footer --path=app/views/layouts
# -> app/views/layouts/_site_footer.html.erb
Placeholder images
Five snippets (hero centered, hero centered_screenshot, hero with_image,
hero cropped_image, features custom_cards) reference placeholder images that
only exist on Bootstrap's docs site, so they 404 until you point them at your own
assets. The generator warns you when you pick one.
Icons
36 of the 62 snippets use Bootstrap Icons through an SVG sprite. Those commands
also write _bootstrap_icons.html.erb next to the partial. Render it once,
near the top of <body> in your layout, or those icons come out as empty boxes:
<%= render "shared/bootstrap_icons" %>
Coding agents
Agents like Claude Code, Cursor and Codex often write outdated Bootstrap from memory
or guess at an app's asset setup. These commands let them use what this gem already
knows instead. The gem doesn't call any AI service and needs no API key.
rails g bootstrap:agent # write a guide tailored to this app
rails g bootstrap:doctor # check how Bootstrap is set up
rails g bootstrap:doctor --json # the same report, for agents and CI
rails g bootstrap:doctor --v6 # also list what changes in Bootstrap 6
rails g bootstrap:header --json # list a snippet's variants as JSON
bootstrap:agent writes .claude/skills/bootstrap-rails/SKILL.md and a section in
AGENTS.md, keeping anything else in that file. Run it again after upgrading the gem
or changing your asset setup. Use --no-claude or --no-agents to skip either one.
bootstrap:doctor writes nothing and exits 1 if a check reports an error, so it also
works as a CI step. It checks:
Check
Looks for
bootstrap_css, bootstrap_js
Whether your layouts actually load Bootstrap, on Propshaft, Sprockets or the CDN
bootstrap_version
CDN tags or vendored files on a different version from the one this gem ships
icon_sprite
The sprite being installed but never rendered, or rendered more than once
placeholder_images
Docs-site images left in your views
legacy_markup
Markup from older Bootstrap versions in app/views, app/helpers and app/components, with file, line and replacement
In an existing app, legacy_markup works as a migration to-do list. Plain names like
close or well may be your own CSS classes, so check those before changing them.
If Bootstrap comes from package.json or your importmap, the doctor warns that it
can't verify it rather than reporting an error.
Preparing for Bootstrap 6
This gem ships Bootstrap 5.3.8. Bootstrap 6 is in alpha (6.0.0-alpha.1 on npm),
and the Bootstrap team publishes an agent skill for the move from 5 to 6. Install it
into your app alongside the gem's own guide:
npx skills add twbs/bootstrap --skill bootstrap-v5-v6-migration
rails g bootstrap:agent # the guide tells agents to stay on Bootstrap 5 markup until you migrate
rails g bootstrap:doctor --v6 # the migration worklist
rails g bootstrap:doctor --v6 --json
--v6 adds a v6_migration check and list: every Bootstrap 5 class, data attribute,
Sass @import and JavaScript call that changes in Bootstrap 6, with file, line and
replacement. For example modal-body becomes dialog-body, col-md-6 becomes
md:col-6, btn-primary becomes btn-solid theme-primary, and
data-bs-toggle="dropdown" becomes data-bs-toggle="menu". It scans app/views,
app/helpers, app/components, app/javascript and your stylesheets, and skips the
Bootstrap files this gem vendored. It reports a warning, never an error, and is off
unless you ask for it.
Things the scan can't do for you:
The vendored assets, bootstrap:install and every generator are still Bootstrap 5.
Switch the assets to Bootstrap 6 before changing markup, and don't re-run the
generators afterwards.
The view helpers (nav_bar, modal_dialog, badge and the rest) render Bootstrap 5
markup at runtime, so their output isn't scanned.
Bootstrap 6 changes the spacing scale, so check p-*/m-* utilities by eye.
Run bootstrap:layout even if you already have a layout — that step is what puts
Bootstrap's CSS and JS on the page.
Upgrading to 5.5.0
5.5.0 changes the HTML that the view helpers produce. They were still
writing Bootstrap 3 markup, so toggles, dropdowns and close buttons did nothing on
Bootstrap 5. If you have custom CSS or tests built on the old output, you'll need to
update them:
nav_bar and the menu helpers use navbar-expand, nav-item and nav-link, and
menu_item puts active on the link rather than the li.
drop_down_submenu renders a labelled group, because Bootstrap 5 has no nested
dropdowns.
badge and tag_label render badge text-bg-*.
render_breadcrumbs renders nav > ol.breadcrumb, and :divider_class no longer
applies.
See the CHANGELOG for the full list. rails g bootstrap:doctor finds
older Bootstrap markup in your own views and helpers.
Upgrading to 5.4.0
5.4.0 is a breaking release:
Less is gone.rails g bootstrap:install less no longer exists; the
argument is now static (default) or cdn. Bootstrap 5 has no Less build, and
the less-rails and execjs dependencies have been dropped.
Glyphicons are gone, including the glyph helper. Bootstrap dropped them in
v4. The snippet generators ship Bootstrap Icons instead.
CoffeeScript support is gone, along with --no-coffeescript.
The gem version no longer tracks the Bootstrap version.
Twitter::Bootstrap::Rails::BOOTSTRAP_VERSION says which Bootstrap ships.
If you are on Rails 8, note that bootstrap:install static previously left
Propshaft apps with no Bootstrap at all — that is fixed here. See the
CHANGELOG for the full list.
Sponsor
Open Collective — back the project with a one-off or monthly contribution
Patreon — become a patron
Bootstrap 5 for Rails — release write-up on Patreon
Buy me a Coffee
☕ Support the Project
Contributors
Thanks to all contributors who are helping to make better.
Star History
License
MIT. Copyright (c) 2025 (since 2011) by Seyhun Akyürek
How active is development on seyhunak/twitter-bootstrap-rails?
The most recent commit recorded on seyhunak/twitter-bootstrap-rails was 14 days ago, based on the GitHub push timestamp. The repository has 970 forks — one of the better signals of community interest.
How many stars does seyhunak/twitter-bootstrap-rails have?
seyhunak/twitter-bootstrap-rails has 4.5k GitHub stars — refresh the page for the live number, or check github.com/seyhunak/twitter-bootstrap-rails. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is seyhunak/twitter-bootstrap-rails written in?
seyhunak/twitter-bootstrap-rails is written primarily in Ruby. GitHub's language field is based on the largest share of bytes in the default branch.
What topics is seyhunak/twitter-bootstrap-rails associated with?
GitHub's repository topics for seyhunak/twitter-bootstrap-rails: "bootstrap", "bootstrap-generator", "rails-gem", "twitter-bootstrap-rails". TopGit's editorial category is open-source.
Where do I read more about seyhunak/twitter-bootstrap-rails?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/seyhunak/twitter-bootstrap-rails is the definitive source.
Read full README in the tab above.
Want a second opinion on twitter-bootstrap-rails?
Ask an AI that can read this page — one click and you get its take on twitter-bootstrap-rails.