This file is the primary source of truth for AI agents working in this repository.
- Framework: Next.js 16 (App Router)
- Language: TypeScript + React 19
- Styling: Tailwind CSS 4
- Component Library: Shadcn UI (registry-driven)
- Icons: Lucide React (preferred), plus existing
iconsax-reactjsand@tabler/icons-reactusage in the repo
- Treat
components/ui/as stable shared primitives. - Prefer implementing uiable-specific visuals in
components/uiable/**and usage sites. - Do not make casual edits to
components/ui/**for single demo needs. - If a
components/ui/**change is truly required (global token alignment, accessibility fix, bug fix, or shared behavior), keep it minimal, backward-compatible, and verify impacted usages.
- Do not introduce wrapper components like
ThemedButton/ThemedBadgeunless explicitly requested. - Prefer direct composition with existing primitives and explicit classes in uiable variants.
- Keep uiable-specific design classes explicit and readable.
- Prefer inline utility classes for variant files so each component remains portable.
- Reuse
cn()when class composition is conditional. - Explicitly define background/text/border classes when variant intent depends on color treatment (
solid,light,outline) so default primitive styles do not leak.
- Preferred approach: one variant per file in
components/uiable/[category]/. - File naming:
[category]-[style]-[color].tsx(lowercase, kebab-case) when applicable. - Existing grouped files (for example,
*-colors.tsx) may remain for backward compatibility; do not remove or break them unless requested. - For new work, prefer standalone variant files over new grouped files.
- Every new exportable component/variant must be added to root
registry.json. - Do not manually edit generated files under
public/r/**unless explicitly requested. - Use
npm run registry:buildafter registry updates.
Use these mappings for consistency across uiable variants:
| Variant | Mapping Rule | Example Class |
|---|---|---|
| Primary | Shadcn primary |
bg-primary |
| Secondary | Shadcn secondary |
bg-secondary |
| Success | Tailwind green | bg-green-600 |
| Danger | Shadcn destructive |
bg-destructive |
| Warning | Tailwind yellow | bg-yellow-500 |
| Info | Tailwind cyan | bg-cyan-500 |
| Dark | Tailwind slate | bg-slate-800 |
Contrast and variant rules:
- Solid variants should use high-contrast text (
text-whitein most cases, especially for success/danger/warning/info/dark). - Light variants should use low-alpha background + colorized text (for example
bg-green-600/10 text-green-700). - Outline variants should include
bg-transparentwhen needed to avoid inherited backgrounds.
- Shared primitives:
components/ui/ - Themed variants:
components/uiable/[category]/ - App routes:
app/** - Global tokens/styles:
app/globals.css - Registry source:
registry.json - Registry build output:
public/r/**
- Check existing patterns in
components/uiable/[category]/. - Identify matching primitives in
components/ui/. - Create/update variant file(s) in
components/uiable/[category]/. - Keep props/types clean and maintain accessibility semantics.
- Add/update item entries in
registry.json. - Run
npm run registry:build. - Run
npm run lintandnpm run type-checkwhen practical.
Refer to component-prompt.md for migration tactics and output style.