Quick Start
1
Install Dependencies
Add Spartan UI and required dependencies to your Angular project.
2
Configure Tailwind
Set up Tailwind CSS with our design tokens and theme configuration.
3
Start Building
Import components and start building with our design system.
Design Principles
Consistency
Maintain visual and functional consistency across all components and interactions.
- Use the same colors from our palette
- Apply consistent spacing scale
- Follow typography hierarchy
Accessibility
Ensure all components are accessible by default with proper ARIA labels and keyboard navigation.
- WCAG AA contrast ratios
- Keyboard navigation support
- Screen reader compatibility
Performance
Optimize components for fast loading and smooth interactions.
- Lazy load heavy components
- Optimize bundle sizes
- Use Angular signals for reactivity
Flexibility
Build components that can adapt to different contexts and use cases.
- Responsive by default
- Dark mode support
- Customizable with variants
Implementation Tips
Always use Spartan UI components first
Always use Spartan UI components first
Check if a component exists in
@spartan-ng before creating custom ones. This ensures consistency and reduces maintenance burden.Use semantic color tokens
Use semantic color tokens
Use
foreground, background, primary, etc. instead of hard-coded colors. This ensures proper dark mode support
and maintainability.Follow the spacing scale
Follow the spacing scale
Use Tailwind’s spacing utilities (
p-4, m-2, gap-6) for consistent spacing throughout the application.Test in both light and dark modes
Test in both light and dark modes
Ensure your components look good in both themes. Always test with the theme toggle to catch any issues.
Mobile-first responsive design
Mobile-first responsive design
Design for mobile by default, then enhance for larger screens with
md:, lg: prefixes.