UI Component Architect
This skill guides the creation of premium, consistent UI components for QoreDB.
Core Principles
- Premium Aesthetics: Avoid default browser styles. Use
bg-primary, text-muted-foreground, etc., from the theme.
- Interactive: All interactive elements must have hover/active states and micro-animations.
- Accessible: Use semantic HTML and
focus-visible states.
- Type-Safe: Use
cva (Class Variance Authority) for variant management.
Workflow
1. Component Structure
Create a new file in src/components/ui/ (or specific feature folder) using the assets/component.tsx template.
- Imports:
framer-motion, cn (clsx/tailwind-merge), cva.
- Variants: Define visual styles using
cva. Avoid hardcoded colors (e.g., bg-blue-500); use CSS variables (e.g., bg-primary).
- Animation: Wrap the root element in
motion.<element> and add subtle initial/animate props.
2. Styling Rules (Tailwind)
- Colors: Use semantic tokens:
primary, secondary, accent, muted, destructive.
- Spacing: Use
gap-2, p-4, etc.
- Borders:
border-input, border (1px default).
- Radius:
rounded-md or rounded-lg.
3. Usage Example
import { Component } from './Component';
export function Demo() {
return (
<Component variant="outline" size="lg">
Click Me
</Component>
);
}
Template
See assets/component.tsx for the full boilerplate.
// Quick Reference
const componentVariants = cva('base-classes...', {
variants: {
variant: { default: '...', outline: '...' },
size: { default: 'h-9 px-4', sm: 'h-8 px-3' },
},
defaultVariants: { variant: 'default', size: 'default' },
});
Checklist
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: ui-component-architect3description: Standardized workflow for creating premium, animated React UI components using Tailwind, Shadcn principles, and Framer Motion. Use when the user asks to "create a component", "design a button", or "add a UI element". Use when this capability is needed.4---56# UI Component Architect78This skill guides the creation of premium, consistent UI components for QoreDB.910## Core Principles11121. **Premium Aesthetics**: Avoid default browser styles. Use `bg-primary`, `text-muted-foreground`, etc., from the theme.132. **Interactive**: All interactive elements must have hover/active states and micro-animations.143. **Accessible**: Use semantic HTML and `focus-visible` states.154. **Type-Safe**: Use `cva` (Class Variance Authority) for variant management.1617## Workflow1819### 1. Component Structure2021Create a new file in `src/components/ui/` (or specific feature folder) using the `assets/component.tsx` template.2223- **Imports**: `framer-motion`, `cn` (clsx/tailwind-merge), `cva`.24- **Variants**: Define visual styles using `cva`. Avoid hardcoded colors (e.g., `bg-blue-500`); use CSS variables (e.g., `bg-primary`).25- **Animation**: Wrap the root element in `motion.<element>` and add subtle `initial`/`animate` props.2627### 2. Styling Rules (Tailwind)2829- **Colors**: Use semantic tokens: `primary`, `secondary`, `accent`, `muted`, `destructive`.30- **Spacing**: Use `gap-2`, `p-4`, etc.31- **Borders**: `border-input`, `border` (1px default).32- **Radius**: `rounded-md` or `rounded-lg`.3334### 3. Usage Example3536```tsx37import { Component } from './Component';3839export function Demo() {40 return (41 <Component variant="outline" size="lg">42 Click Me43 </Component>44 );45}46```4748## Template4950See `assets/component.tsx` for the full boilerplate.5152```tsx53// Quick Reference54const componentVariants = cva('base-classes...', {55 variants: {56 variant: { default: '...', outline: '...' },57 size: { default: 'h-9 px-4', sm: 'h-8 px-3' },58 },59 defaultVariants: { variant: 'default', size: 'default' },60});61```6263## Checklist6465- [ ] Used `cva` for variants66- [ ] Added `framer-motion` for micro-interactions67- [ ] Used semantic colors (not raw hex/names)68- [ ] Forwarded `ref` correctly69- [ ] Exported `Component` and `componentVariants`7071---72> Converted and distributed by [TomeVault](https://tomevault.io/claim/qoredb) — claim your Tome and manage your conversions.73<!-- tomevault:4.0:skill_md:2026-04-11 -->