Torque Admin ships with first-class support for four CSS frameworks — Bootstrap, Bulma, Tailwind, and Semantic UI (Fomantic-UI). The active theme controls how every UI primitive (buttons, badges, loaders, segments, etc.) is rendered, and it can be extended or completely overridden without forking the engine. Switching frameworks is a single config change; the rest of the admin adapts automatically.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/crashtech/torque-admin/llms.txt
Use this file to discover all available pages before exploring further.
Torque Admin provides the component layer for each framework but does not bundle the framework’s CSS or JavaScript assets. You must add the chosen framework’s stylesheet to your application layout (e.g. via a CDN link, a gem, or your asset pipeline) independently of this setting.
Setting the Theme
Setconfig.theme to one of the four supported values in your initializer or in the inline configure block when mounting the engine:
Torque::Elements::Helpers:
| Config value | Helper module |
|---|---|
'bootstrap' | Torque::Elements::Helpers::Bootstrap |
'bulma' | Torque::Elements::Helpers::Bulma |
'semantic_ui' | Torque::Elements::Helpers::SemanticUI |
'tailwind' | No dedicated theme module — uses Tailwind utility classes directly |
UiBuilder.add_framework is called with the theme name and the corresponding module, creating a dedicated UiBuilder subclass that has all component definitions baked in.
Theme Configuration by Framework
- Semantic UI
- Bootstrap
- Bulma
- Tailwind
Semantic UI (and its community fork Fomantic-UI) uses human-readable class names. The helper module is
Add Fomantic-UI to your layout:
Torque::Elements::Helpers::SemanticUI.ICON format: "icon %s" (e.g. "icon home")SIZES mapping: mini tiny small default large big huge massive (plus numeric aliases 1–8)Defined elements:| Element | Default tag | Notable presets / notes |
|---|---|---|
button | <button class="ui button"> | Presets: :default, :multiple (renders as <div class="ui buttons">) |
container | <div class="ui container"> | Toggles: text, fluid, resizable |
divider | <div class="ui divider"> | Toggles: vertical, horizontal, fitted, hidden, section |
emoji | <em> | Argument :name assigned to data-emoji; no content rendered; imports: size |
flag | <i class="ui flag"> | Argument :name assigned to class; no content rendered |
header | <div class="ui header"> | Imports: icon, size, color; toggles: sub, dividing, block, inverted |
icon | <i> | Argument :name formatted with ICON; no content rendered |
image | <img class="ui image"> | Toggles: avatar, bordered, fluid, rounded, circular, centered |
badge | <span class="ui label"> | Preset :multiple → <div class="ui labels">; imports: icon, size, color |
loader | <div class="ui loader"> | Toggles: text, indeterminate, active, inverted; imports: size, color |
placeholder | <div class="ui placeholder"> | Toggles: fluid, inverted |
rail | <div class="ui rail"> | Toggles: internal, dividing, attached; property: position |
reveal | <div class="ui reveal"> | Argument :type; toggles: instant, disabled, active |
segment | <div class="ui segment"> | Preset :multiple → segments wrapper; many toggles |
step | <div class="ui step"> | Preset :multiple → steps wrapper; imports: icon, size, color |
text | <span class="ui text"> | Imports: size, color |
menu | <div class="ui menu"> | Preset :submenu; toggles: secondary, vertical, inverted, fluid, etc. |
menu_item | <a class="item"> | Preset :header → <div class="header"> |
Page Frames
Frames are the outermost HTML chrome that wrap every rendered admin page — they sit between the view template and the application layout and control the placement of the navigation menu, header, main content area, and footer. Torque Admin ships with four built-in frames:| Frame | Description |
|---|---|
classic | Top navigation menu + full-width <main> + footer. Simple horizontal chrome. |
modern | Fixed top <header> with the app banner + vertical sidebar menu + scrollable content area + footer. |
sidebar | Flex-row layout with a left vertical sidebar (menu + banner) + right <main> area + footer. |
minimal | Bare wrapper with no chrome — useful for login pages, error pages, or highly custom layouts. |
BaseController:
Extending the Theme
theme_extensions lets you add custom UI components or override existing ones without changing the source theme. Extensions are applied directly to the theme’s UiBuilder subclass in the order they appear in the array.
Using a Proc (for quick DSL additions):
