components
UI component patterns for React 19, shadcn/ui, and Tailwind. Use when working on files in src/components/.
SKILL.md.claude/skills/components
GitHubComponents Guidelines
Patterns
"use client"only if using hooks/interactivity- Export interface with
Propssuffix, document props with JSDoc - Always include optional
classNameprop, usecn()for merging
Styling
- Tailwind only - no CSS modules or styled-components
- Use shadcn/ui tokens:
text-muted-foreground,bg-background, etc. - All components must support dark mode via
dark:prefix
State
- Local:
useStatefor UI-only state (dropdowns, modals) - CRDT:
useVaultAction/useActiveTransactionsfor data mutations - URL:
useSearchParamsfor filters that should persist
Performance
useMemo/useCallbackfor expensive computations and callbacks to memoized children- Virtualize long lists (TransactionTable already does this)
- Avoid inline object/array literals in JSX props
Accessibility
- Semantic HTML, aria-labels on icon-only buttons
- Keyboard navigation, focus management in modals
Keyboard shortcuts and commands
- Every shortcut is a command in the registry (
src/lib/commands). The palette (Cmd/Ctrl+K), the keyboard bindings and the?cheat sheet all read it, so never add a barekeydownlistener for a page shortcut. Component-local keys (Escape in a popup, the grid's own cell keys) stay local. - Define a command's id, title, keywords and shortcut in
src/lib/commands/catalog.ts; register its behaviour while mounted withuseCommandsfrom@/components/features/commands, passing a memoised array. Usewhenfor availability ("a row is selected") rather than registering conditionally. - Bindings use tinykeys syntax (
$mod+KeyK,Alt+KeyN,[Shift]+?,g t). A binding without Cmd/Ctrl/Alt never fires in a text field or the grid; a modified one fires in a text field only withinTextEntry: true.$modis Cmd on a Mac and Ctrl elsewhere;alsoKeysare bound but not listed (Undo keeps Ctrl+Z and Cmd+Z on every platform). Do not take Cmd+N/T/W or plain Cmd+F. - Keys the grid handles itself are listed as
GRID_REFERENCE_COMMANDSso the cheat sheet stays complete; update them alongsidetable-model/grid-key-intent.ts.