shadcn Conventions
Use this file before changing UI component scaffolding.
Workspace scope
- shadcn-generated UI currently lives in
apps/widgets. - The template at
templates/grist-widget-template-viteis separate and may have similar but independent UI setup.
Add a component
From repository root:
bash
pnpm dlx shadcn@latest add button -c apps/widgetsOr inside the workspace:
bash
cd apps/widgets && pnpm dlx shadcn@latest add buttonRules
- Treat files under
apps/widgets/src/components/ui/as generated primitives. - Prefer wrappers in
apps/widgets/src/components/for app-specific customization. - Use
cn()fromapps/widgets/src/lib/utils.tsfor class composition. - Keep imports on alias paths (example:
@/components/ui/button).