RetailysUI

Design Guidelines

Principles, rules, and best practices for building consistent, accessible, and performant interfaces with Retailys UI Design Framework.

Design Principles

Core values that guide every design and engineering decision.

Consistency

Maintain visual and behavioral consistency across all interfaces. Reuse existing components and patterns rather than creating new ones.

Accessibility

Build for everyone. All components use React Aria for keyboard navigation, screen reader support, and WCAG 2.1 AA compliance.

Responsiveness

Design mobile-first. Every component and layout adapts seamlessly from 320px mobile to 2560px ultrawide displays.

Performance

Keep bundles small and interactions fast. Use code splitting, lazy loading, and efficient re-renders.

Color Usage

Guidelines for applying colors consistently across the design system.

Semantic Color Roles

BrandPrimary actions, active states, links, brand identity
GrayNeutral UI, borders, backgrounds, secondary text
SuccessPositive outcomes, confirmations, completion states
WarningCaution, pending actions, soft alerts
ErrorDestructive actions, validation errors, failures

Dark Mode

The design system uses CSS custom properties (--color-*) that automatically adapt between light and dark themes. Use semantic color classes (bg-primary, text-secondary, border-secondary) rather than hardcoded colors.

Typography Rules

Consistent type hierarchy for readability and visual rhythm.

Hierarchy

Display 2xl - xsPage headings and hero text
Text xl - lgSection headings and emphasis
Text mdBody text (default)
Text smSecondary text, labels, captions
Text xsFootnotes, badges, small labels

Font Weights

font-semibold (600)Headings, buttons, labels
font-medium (500)Navigation items, sub-headings
font-normal (400)Body text, descriptions

Spacing System

A consistent spatial scale based on a 4px grid.

Scale

0
0px
0.5
2px
1
4px
1.5
6px
2
8px
2.5
10px
3
12px
3.5
14px
4
16px
5
20px
6
24px
8
32px
10
40px
12
48px
16
64px
20
80px
24
96px

Conventions

Component padding

p-4 (16px) for cards, p-6 (24px) for sections, p-8 (32px) for page containers

Gap between elements

gap-2 (8px) tight, gap-4 (16px) standard, gap-6 (24px) spacious, gap-8 (32px) sections

Page margins

px-4 md:px-8 (16px → 32px responsive)

Component Composition

Recurring layout recipes for common UI patterns.

Common Patterns

Form Layout

Stack inputs vertically with gap-4. Use label + input + hint pattern. Group related fields in fieldsets.

Card Layout

rounded-xl border border-secondary bg-primary p-6. Use FeaturedIcon for visual anchor.

Table Page

TableCard.Header for title/description/actions → Table with sortable headers → Pagination footer.

Dashboard Grid

Stats row (grid-cols-4) → Charts row (grid-cols-2) → Detail table below.

Accessibility

Building interfaces that work for everyone.

React Aria Foundation

All interactive components are built on React Aria Components, providing out-of-the-box accessibility including keyboard navigation, focus management, screen reader announcements, and ARIA attributes.

Key Patterns

  • All form fields have associated labels (visible or aria-label)
  • Focus rings use outline-focus-ring utility
  • Modals trap focus and restore on close
  • Tooltips are announced on focus, not just hover
  • Color is never the sole indicator of state (always paired with text/icons)

Dark Mode

Seamless light and dark theming across every component.

Implementation

Theme Provider uses next-themes with class strategy
.light-mode and .dark-mode classes on root element
CSS variables remap automatically between themes
ThemeToggle component for user control

Guidelines

Always use semantic color tokens (bg-primary, text-secondary) not raw colors
Test all components in both modes
Ensure sufficient contrast in both themes (4.5:1 minimum for text)

Responsive Design

Adapting layouts across all screen sizes.

Breakpoints

TokenMin-WidthDescription
sm640pxMobile landscape
md768pxTablet
lg1024pxDesktop
xl1280pxLarge desktop
2xl1536pxUltra-wide

Patterns

Sidebar: Fixed on lg+, drawer on mobile
Grids: 1 col → 2 col → 4 col responsive
Typography: text-display-xs → text-display-sm on md+
Spacing: px-4 → px-8 on md+