CogniPrep's entire design system is one directory:
components/ui/ alert-dialog.tsx badge.tsx button.tsx card.tsx dialog.tsx dropdown-menu.tsx form-input.tsx fullscreen-dialog.tsx input.tsx label.tsx nav-button.tsx password-input.tsx skeleton.tsx textarea.tsx
Enter fullscreen mode
Exit fullscreen mode
Fourteen files, five Radix dependencies, and each Radix package is imported by exactly one of them:
grep -rho "@radix-ui/[a-z-]*" --include = "*.tsx" components | sort | uniq -c # 1 @radix-ui/react-alert-dialog # 3 @radix-ui/react-dialog # 1 @radix-ui/react-dropdown-menu # 1 @radix-ui/react-label # 1 @radix-ui/react-slot
Enter fullscreen mode
Exit fullscreen mode
That encapsulation is the part I would keep: nothing outside components/ui knows Radix exists, so replacing a primitive is a one-file change.…