@sd/ui. These components provide consistent styling and behavior across the application.
Design Principles
Composition Over Configuration
Primitives are simple, composable building blocks rather than complex configured components.Semantic Color Usage
All primitives use semantic color tokens, never raw Tailwind colors.Consistent Patterns
Common patterns are standardized across primitives: Card Pattern:Core Primitives
Button
Versatile button component with multiple variants and sizes.default- Transparent with border, hover/active statesgray- App button background with hover/focus statesaccent- Accent blue background with white textsubtle- Transparent border, subtle hoveroutline- Sidebar line border styledotted- Dashed border for add/create actionscolored- Custom colored backgrounds (pass bg color class)bare- No styling whatsoever
xs- Extra small (px-1.5 py-0.5, text-xs)sm- Small (px-2 py-0.5, text-sm) - defaultmd- Medium (px-2.5 py-1.5, text-sm)lg- Large (px-3 py-1.5, text-md)icon- Square icon button (!p-1)
Input
Form input with semantic styling and size variants.default- Standard input with border and backgroundtransparent- Transparent background, no border on focus
xs- 25px heightsm- 30px height (default)md- 36px heightlg- 42px heightxl- 48px height
error- Shows error state (red border/ring)icon- Icon component or React nodeiconPosition-'left'|'right'(default:'left')right- React node to display on the right sideinputElementClassName- Additional classes for the input element itself
SearchInput- Input with MagnifyingGlass icon pre-configuredPasswordInput- Input with eye icon toggle for show/hide passwordTextArea- Multi-line text input with same styling systemLabel- Semantic label component with slug prop for htmlFor
Form Components
React Hook Form integration with automatic validation display.Switch
Toggle switch for boolean settings.ShinyToggle
Animated toggle component for switching between multiple options with a smooth glowing indicator.- Smooth animated indicator using Framer Motion
- Gradient background with glow effect
- Optional count badges
- Type-safe with generics
- Fully accessible
value- Current selected value (generic type T)onChange- Callback when selection changesoptions- Array of{ value: T, label: ReactNode, count?: number }className- Additional classes for the container
DropdownMenu
Context menu and dropdown with Radix UI.Glassmorphism Effect
Spacedrive’s signature glassmorphism effect combines backdrop blur, transparency, and gradient borders.noise- Base noise texturenoise-faded- Faded intensitynoise-sm- Small grain size
Progress Bars
Consistent progress bar pattern for resource usage.- Storage:
bg-accent(blue) - AI/Compute:
bg-purple-500 - Bandwidth:
bg-green-500 - Progress:
bg-blue-500 - Success:
bg-green-400
Status Badges
Standard status badge pattern.Empty States
Pattern for when lists/grids are empty.Gradients
Background Gradients
Border Gradients
Typography Scale
Consistent text sizing across the app.text-xs(12px) - Helper text, labelstext-sm(14px) - Body text, descriptionstext-base(16px) - Default bodytext-lg(18px) - Subheadingstext-xl(20px) - Section titlestext-2xl(24px) - Card titlestext-3xl(30px) - Page titles
Icons
Use Phosphor Icons with consistent sizing and weights.regular- Default, inactive statesfill- Active states, buttons, emphasisbold- Strong emphasis
Spacing Scale
Consistent spacing using Tailwind’s scale. Common patterns:- Card padding:
p-6 - Button padding:
px-3 py-1.5(md),px-2.5 py-1.5(sm) - Section spacing:
space-y-4orspace-y-6 - Grid gaps:
gap-4orgap-6 - Icon-text gap:
gap-2orgap-3
Accessibility
Color Contrast
All semantic colors meet WCAG AA standards:text-inkonbg-app- AAAtext-ink-dullonbg-app-box- AAtext-ink-faintonbg-app-input- AA (minimum)
