Introduction
Kiso (基礎 — Japanese: foundation) is a Rails engine gem providing UI components inspired by shadcn/ui and Nuxt UI.
ERB partials, Tailwind CSS, progressive Stimulus.
Why Kiso?
Most Rails UI libraries ask you to adopt a new abstraction — ViewComponent
classes, Phlex objects, or DSL builders. Kiso stays with what Rails gives you:
ERB partials, yield, and strict locals. If you can call render, you can use
Kiso.
The kui() helper renders a partial with variant-aware Tailwind classes computed
by class_variants. Dark mode,
color theming, and class deduplication work automatically.
Get started
See the Getting Started guide to install Kiso and render your first component.
Architecture
Kiso has two layers:
- Ruby theme modules — variant definitions using
class_variants+tailwind_merge - ERB partials — strict locals, computed class strings, composition via
yield
Components never use @apply in CSS. Tailwind classes are computed in Ruby and
rendered in ERB. CSS files are only used for transitions, animations, and
pseudo-states that ERB can’t express.
Design principles
- Native HTML first. Use
<dialog>,[popover],<details>before adding JavaScript. - Build from small parts. Card = Header + Title + Content + Footer.
- ERB is enough. Use strict locals and
yieldfor blocks. - Tailwind classes in ERB. CSS files only hold transitions and pseudo-states.
- Theme with tokens. Names like
primarymap to real colors. They flip in dark mode. - Works with Turbo. Use them in Turbo Frames and Streams.
- Stimulus only when needed. Native HTML handles the basics. Stimulus adds the rest.
Components
Browse the available components in the sidebar, or see the Design System page for the visual reference.