Version 3 of the kit: - Radix UI replaced with Base UI (using the Shadcn UI patterns) - next-intl replaces react-i18next - enhanceAction deprecated; usage moved to next-safe-action - main layout now wrapped with [locale] path segment - Teams only mode - Layout updates - Zod v4 - Next.js 16.2 - Typescript 6 - All other dependencies updated - Removed deprecated Edge CSRF - Dynamic Github Action runner
2.3 KiB
2.3 KiB
@kit/ui — UI Components & Styling
Component Library
This project uses Base UI (not Radix UI). Key differences:
- NEVER use
asChildprop — Base UI usesrenderprop for element composition - ALWAYS use the
renderprop pattern when you need to render a custom element (e.g.,<Button nativeButton={false} render={<Link />} />)
Non-Negotiables
- ALWAYS import as
@kit/ui/<name>— no deep paths, no matter the folder structure - ALWAYS use
cn()from@kit/ui/utilsfor class merging - ALWAYS use semantic Tailwind classes (
bg-background,text-muted-foreground) — NEVER hardcoded colors (bg-white,text-gray-500) - ALWAYS add
data-testattributes on interactive elements - ALWAYS add
FormMessageto every form field for error display - ALWAYS consider error-handling, not just happy paths.
- ALWAYS Ensure UI surfaces useful and human-readable errors, not internal ones.
- NEVER add generics to
useForm— let Zod resolver infer types - NEVER use
watch()— useuseWatchhook instead when using React Hook Form - NEVER use Radix UI patterns (
asChild,@radix-ui/*imports) — this project uses Base UI
Skills
/react-form-builder— Full form implementation workflow with react-hook-form + Zod
Key Components
| Component | Import |
|---|---|
| Button, Card, Input, etc. | @kit/ui/<name> |
| Form fields | FormField, FormItem, FormLabel, FormControl, FormMessage from @kit/ui/form |
| Translations | Trans from @kit/ui/trans |
| Toast | toast from @kit/ui/sonner |
| Conditional render | If from @kit/ui/if |
| Class merging | cn from @kit/ui/utils |
Zod
- ALWAYS import Zod as
import * as z from 'zod' - Place schemas in a separate file so they can be reused with server actions