--- title: Rails order: 9 summary: Set up Tabler in Rails and build a first working page. description: Install Tabler in Rails - load the CSS and JS with the standard bundling gems and render a minimal ERB layout with a Tabler card. icon: diamond seoDescription: Install `@tabler/core`, load CSS and optional JS in Rails, and render a minimal page layout with a Tabler card. --- import TabsPackage from '@components/TabsPackage.astro' import CdnImportPackage from '@components/CdnImportPackage.astro' import Steps from '@components/Steps.astro' Rails renders server-side HTML through ERB templates, so Tabler classes work directly in your views, and the compiled CSS and JS integrate with the standard Rails bundling gems (`cssbundling-rails` and `jsbundling-rails`). You will install `@tabler/core`, import its assets in your application bundles, and render a first view with a Tabler card. ## Setup ### Install Tabler package Install `@tabler/core` with your preferred package manager: You can also use CDN files when you need a quick setup: ### Import styles For Rails with `cssbundling-rails`, import Tabler CSS in `app/assets/stylesheets/application.scss`: ```scss @import '@tabler/core/dist/css/tabler.min.css'; ``` For full theme customization, import SCSS sources instead: ```scss @use '@tabler/core/scss/tabler'; ``` ### Import and initialize JavaScript Tabler JavaScript is required for interactive components such as dropdowns, modals, and tooltips. If you use `jsbundling-rails`, import Tabler JS in `app/javascript/application.js`: ```js import '@tabler/core/dist/js/tabler.min.js' ``` Rails-specific note: if you use `importmap-rails` without npm bundling, prefer CDN for Tabler JS or add compiled files to your asset pipeline and include them from your layout. ### Minimal working example Create a simple layout in `app/views/layouts/application.html.erb`: ```erb <%= csrf_meta_tags %> <%= csp_meta_tag %> <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %> <%= yield %> ``` Then add a simple page in `app/views/home/index.html.erb`: ```html

Rails + Tabler

Your Tabler setup is working.

``` Run the app: ```shell bin/rails server ``` Open the local Rails URL and confirm the card is styled with Tabler. ### Next steps - Continue with [Customize](/ui/getting-started/customize) to adjust styles and build setup. - Explore [Layout](/ui/layout) to choose page structures. - Browse [Components](/ui/components) to add UI building blocks.