UI Design System

Documentation of Hardal's UI components and design patterns

3 min read

UI Design System

At Hardal, we use shadcn/ui as the foundation for our user interface components. This provides us with a consistent, accessible, and customizable design system that aligns with our brand identity.

Why shadcn/ui?

We chose shadcn/ui for several key reasons:

  1. Component-First Approach: shadcn/ui provides beautifully designed, accessible components that we can copy and paste directly into our projects.

  2. Customization: Unlike traditional component libraries, shadcn/ui allows us to own and customize the code, giving us complete control over our UI.

  3. Tailwind CSS Integration: Built on Tailwind CSS, it provides a utility-first approach that makes styling efficient and consistent.

  4. Radix UI Foundation: The components are built on Radix UI primitives, ensuring accessibility and robust interaction patterns.

  5. Modern Design Language: The aesthetic aligns well with our brand's balance of professionalism and approachability.

Color System

Our color system is defined through CSS variables in our global stylesheet. The primary colors reflect our brand identity, with mustard yellow as our primary accent color.

Base Colors

Variable Light Mode Dark Mode Usage
--primary Mustard yellow Lighter mustard Primary actions, focus states
--secondary Light gray Dark gray Secondary actions, backgrounds
--accent Soft yellow Muted yellow Highlights, accents
--destructive Red Lighter red Error states, destructive actions

Semantic Colors

Variable Purpose
--background Page backgrounds
--foreground Primary text
--card Card backgrounds
--card-foreground Text on cards
--popover Popover backgrounds
--popover-foreground Text on popovers
--muted Muted backgrounds
--muted-foreground Muted text
--border Borders
--input Form input borders
--ring Focus rings

Typography

We use a combination of fonts to create a distinctive but readable typographic hierarchy:

  • Primary Font: Inter (sans-serif) for most UI text
  • Secondary Font: Poppins (sans-serif) for most UI text
  • Accent Font: Lora (serif) for specific accent text

Type Scale

We follow a consistent type scale throughout our applications:

Size Usage
xs (0.75rem) Fine print, captions
sm (0.875rem) Secondary text
base (1rem) Body text
lg (1.125rem) Emphasized body text
xl (1.25rem) Subheadings
2xl (1.5rem) Section headings
3xl (1.875rem) Page headings
4xl (2.25rem) Major headings

Component Usage

For detailed documentation on how to use specific components, refer to the shadcn/ui documentation. When implementing components, maintain these principles:

  1. Consistency: Use components as designed without unnecessary modifications
  2. Accessibility: Preserve accessibility features built into the components
  3. Responsiveness: Ensure components work well across all device sizes
  4. Performance: Keep component implementations lightweight