UI Skills
Apply these constraints to all UI work. When reviewing a file, output: violation (exact line), why it matters (1 sentence), concrete fix (code).
Stack
- Use Tailwind CSS defaults unless custom values already exist or are explicitly requested.
- Use
motion/react(formerlyframer-motion) for JavaScript animation. - Use
tw-animate-cssfor entrance and micro-animations. - Use
cnutility (clsx+tailwind-merge) for class logic.
Components
- Use accessible primitives (
Base UI,React Aria,Radix) for keyboard/focus behavior. - Use the project's existing component primitives first.
- NEVER mix primitive systems within the same interaction surface.
- Prefer
Base UIfor new primitives if compatible. - Add
aria-labelto icon-only buttons. - NEVER rebuild keyboard or focus behavior by hand.
Interaction
- Use
AlertDialogfor destructive or irreversible actions. - Use structural skeletons for loading states.
- Use
h-dvhinstead ofh-screen. - Respect
safe-area-insetfor fixed elements. - Show errors next to where the action happens.
- NEVER block paste in
inputortextarea.
Animation
- NEVER add animation unless explicitly requested.
- Animate only compositor props (
transform,opacity). - NEVER animate layout properties (
width,height,top,left,margin,padding). - Avoid animating paint properties (
background,color) except for small local UI. - Use
ease-outon entrance. - NEVER exceed
200msfor interaction feedback. - Pause looping animations when off-screen.
- Respect
prefers-reduced-motion. - NEVER introduce custom easing curves unless explicitly requested.
Typography
- Use
text-balancefor headings,text-prettyfor body/paragraphs. - Use
tabular-numsfor data. - Use
truncateorline-clampfor dense UI. - NEVER modify
letter-spacingunless explicitly requested.
Layout
- Use a fixed
z-indexscale (no arbitraryz-*). - Use
size-*for square elements instead ofw-*+h-*.
Performance
- NEVER animate large
blur()orbackdrop-filtersurfaces. - NEVER apply
will-changeoutside an active animation. - NEVER use
useEffectfor anything expressible as render logic.
Design
- NEVER use gradients unless explicitly requested.
- NEVER use purple or multicolor gradients.
- NEVER use glow effects as primary affordances.
- Use Tailwind default shadow scale unless explicitly requested.
- Give empty states one clear next action.
- Limit accent color to one per view.
- Use existing theme or Tailwind color tokens before introducing new ones.
Error Handling
- If a constraint conflicts with an explicit user request, follow the user request and note the deviation.
- If a component violates multiple constraints, report all violations sorted by severity (accessibility > performance > design).