Installation
Install and configure elorm/ui in your project.
Recommended
Run elorm init in your project root to scaffold configuration, tokens, and utilities automatically.
Prerequisites#
- Node.js 20.9+
- A React project (Next.js or Vite recommended)
- Tailwind CSS v4 configured
Initialize#
Run the init command in your project root:
This creates:
elorm.json— project configuration (framework, UI library, theme)lib/utils.ts—cn()utility- Global CSS with OKLCH design tokens
During init you'll choose:
- Framework — Next.js or Vite
- UI library — Base UI, Radix UI, or HeroUI
- Base color — neutral, zinc, slate, stone, or gray
- Accent color — blue, violet, green, orange, rose, and more
- Border radius — default, compact, or round
Add components#
# Add multiple at once
elorm add card dialog
elorm add empty-stateComponents are copied into your project at the paths defined in elorm.json.
Choosing a UI library#
elorm/ui supports three headless primitive libraries. Your choice is stored in elorm.json as uiLibrary:
| Library | Best for |
|---|---|
| Base UI | Modern unstyled primitives, smaller surface area |
| Radix UI | Battle-tested ecosystem, familiar API |
| HeroUI | React Aria + Tailwind v4 with elorm wrapper styling (Preview — early primitives) |
Non-primitive components (input, card, badge, blocks) are shared between libraries. Only headless primitives differ.
# Non-interactive init with Radix
elorm init -y --ui-library radix --base-color zinc --accent blue
# Non-interactive init with HeroUI
elorm init -y --ui-library heroui --base-color neutral --accent monoFramework setup#
elorm/ui works with the Next.js App Router. Client components include "use client" automatically.