
twitter-bootstrap-rails
Twitter Bootstrap for Rails 8
Install with your AI
Paste into Claude Code, Cursor, or any agent — it reads the repo and wires the tool into your project.
Install and set up twitter-bootstrap-rails (git-clone project) into my current project. Found on https://claudeers.com/twitter-bootstrap-rails Repo: https://github.com/seyhunak/twitter-bootstrap-rails Homepage/docs: https://github.com/seyhunak/twitter-bootstrap-rails Detected install method: git-clone → git clone https://github.com/seyhunak/twitter-bootstrap-rails Category: uncategorized. Platforms: api, mobile. Read the repo's README for exact setup and env vars, then install it and wire it into my project. Claudeers Health Verdict: unknown; community-verified: false. Confirm the source before running anything.
git clone https://github.com/seyhunak/twitter-bootstrap-rails
// compatibility
| Platforms | api, mobile |
|---|---|
| Operating systems | — |
| AI compatibility | claude |
| License | — |
| Pricing | open-source |
| Language | Ruby |
twitter-bootstrap-rails
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 railsin your app. Security support for Rails 8.0 ends on 7 November 2026, and older series are already unsupported.
Install
# Gemfile
gem "twitter-bootstrap-rails"
bundle install
rails generate bootstrap:install static
Generators
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
| Command | Variants |
|---|---|
rails g bootstrap:header | centered, nav_pills, with_auth_buttons, dark_search, light_search, grid_dropdown, double, dark_double |
rails g bootstrap:hero | centered, centered_screenshot, with_image, signup_form, cropped_image, dark |
rails g bootstrap:features | columns_with_icons, hanging_icons, custom_cards, icon_grid, with_title |
rails g bootstrap:sidebar | dark, light, icon_only, collapsible, list_group |
rails g bootstrap:footer | simple, with_brand, with_nav, columns, with_newsletter |
rails g bootstrap:dropdown | simple, with_search, with_icons, calendar, mega_menu |
rails g bootstrap:list_group | with_avatars, checkboxes, checkboxes_expanded, checkable, radios |
rails g bootstrap:modal | sheet, confirm, whats_new, signup |
rails g bootstrap:badge | pills, subtle, subtle_bordered, with_avatar, with_icons, with_avatar_divider |
rails g bootstrap:breadcrumb | basic, with_icons, chevron, custom |
rails g bootstrap:button | pills, grid, with_icons, loading, circle |
rails g bootstrap:jumbotron | with_icon, placeholder, full_width, basic |
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: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.
Quick Start
rails new myapp
cd myapp
echo 'gem "twitter-bootstrap-rails"' >> Gemfile
bundle install
rails generate bootstrap:install static
rails generate scaffold Task title:string description:text completed:boolean
rails db:migrate
rails generate bootstrap:themed Tasks
rails generate bootstrap:layout application
rails server
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_barand the menu helpers usenavbar-expand,nav-itemandnav-link, andmenu_itemputsactiveon the link rather than theli.drop_down_submenurenders a labelled group, because Bootstrap 5 has no nested dropdowns.badgeandtag_labelrenderbadge text-bg-*.render_breadcrumbsrendersnav > ol.breadcrumb, and:divider_classno 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 lessno longer exists; the argument is nowstatic(default) orcdn. Bootstrap 5 has no Less build, and theless-railsandexecjsdependencies have been dropped. - Glyphicons are gone, including the
glyphhelper. 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_VERSIONsays 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
// faq
What is twitter-bootstrap-rails?
Twitter Bootstrap for Rails 8. It is open-source on GitHub.
Is twitter-bootstrap-rails free to use?
twitter-bootstrap-rails is open-source, so it is free to use.
What category does twitter-bootstrap-rails belong to?
twitter-bootstrap-rails is listed under uncategorized in the Claudeers registry of Claude-compatible tools.
// embed badge
[](https://claudeers.com/twitter-bootstrap-rails)
// retro hit counter
[](https://claudeers.com/twitter-bootstrap-rails)
// reviews
// guestbook
// related in Uncategorized / Others
Reverse engineer anything with agents, from app behavior down to native binaries.
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
The agent engineering platform.
100+ AI Agent & RAG apps you can actually run — clone, customize, ship.