Getting Started
Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Dropdown Menu
- Empty
- Field
- Form Field
- Hover Card
- Icon
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Label
- Menubar
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner (Toast)
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Tooltip
Stack
Dark Mode
Toggle between light and dark themes with a single class.
spartan/ui supports dark mode out of the box. Add the dark class to your <html> element, and all CSS variables automatically switch to their dark mode values.
No component changes required. All spartan primitives adapt automatically.
Implementation
For a complete implementation including:
- Persisting user preference with localStorage
- Respecting system color scheme
- Preventing theme flash on SSR
- Angular service with signals
See this comprehensive guide: Dark mode with Angular & Tailwind