--- id: wiki-2026-0508-component-library-architecture title: Component Library Architecture category: 10_Wiki/Topics status: verified canonical_id: self aliases: [Design System Architecture, UI Library Design] duplicate_of: none source_trust_level: A confidence_score: 0.9 verification_status: applied tags: [components, design-system, react, shadcn, radix] raw_sources: [] last_reinforced: 2026-05-10 github_commit: pending tech_stack: language: typescript framework: react-radix-shadcn --- # Component Library Architecture ## 매 한 줄 > **"매 unstyled headless primitives + 매 style layer + 매 composition API."**. 2026년 React component library 의 dominant model = Radix/Ark UI (headless behavior + a11y) + Tailwind/CSS variables (theming) + shadcn/ui (copy-not-install) + tokens (DTCG). MUI 5 의 monolithic theme 시대 → headless 시대로 매 shift. ## 매 핵심 ### 매 3 layer architecture 1. **Behavior layer (headless)**: a11y, keyboard, focus, ARIA — Radix, Ark UI, React Aria. 2. **Style layer**: Tailwind, CSS-in-JS (vanilla-extract), CSS variables. 3. **Composition layer**: app-specific compositions of 1+2. ### 매 distribution model - **Package install** (MUI, Chakra v3): npm install, version locked, hard to customize. - **Copy-paste** (shadcn/ui): generator copies source into your repo, you own it, fully customizable. - **Hybrid** (Radix + custom wrapper): primitives via npm, your styles in repo. ### 매 token system (DTCG / Style Dictionary) - Primitive tokens (color.blue.500 = #3b82f6). - Semantic tokens (color.action.primary = color.blue.500). - Component tokens (button.bg.primary = color.action.primary). ### 매 응용 1. Internal design system (Vercel Geist, GitHub Primer). 2. Open-source kits (shadcn/ui, Mantine, Park UI). 3. White-label products (multi-brand 동일 codebase). 4. Cross-framework via Web Components (Spectrum Web Components). ## 💻 패턴 ### Headless primitive (Radix) ```typescript import * as Dialog from '@radix-ui/react-dialog'; export function ConfirmDialog({ open, onClose, onConfirm, children }: Props) { return ( Confirm {children}
Cancel
); } ``` ### shadcn-style copy-paste component ```typescript // components/ui/button.tsx — owned by your repo import { cva, type VariantProps } from 'class-variance-authority'; import { cn } from '@/lib/utils'; const buttonVariants = cva( 'inline-flex items-center justify-center rounded-md text-sm font-medium transition', { variants: { variant: { primary: 'bg-blue-600 text-white hover:bg-blue-700', ghost: 'hover:bg-gray-100', }, size: { sm: 'h-8 px-3', md: 'h-10 px-4', lg: 'h-12 px-6', }, }, defaultVariants: { variant: 'primary', size: 'md' }, }, ); type Props = React.ButtonHTMLAttributes & VariantProps; export function Button({ className, variant, size, ...rest }: Props) { return (