Skip to main content

Layout & Spacing

:::tip Core Principle The spacing system is based on a 4px base grid — all spacing values are multiples of 4. Managed through a unified Spacing Scale to ensure consistent visual rhythm and clear hierarchy. :::


Spacing Scale

TokenValueUsage
spacing-44pxIcon-to-text gap, tight element inner spacing
spacing-88pxForm element inner spacing, list item spacing
spacing-1212pxButton inner spacing, card element spacing
spacing-1616pxCard padding, section spacing
spacing-2424pxModule spacing, group spacing
spacing-3232pxLarge section spacing
spacing-4040pxPage-level section spacing
spacing-4848pxPage-level large spacing
spacing-7272pxPage top / bottom large whitespace

The spacing number equals its pixel value: spacing-16 = 16px — intuitive with no conversion needed.


Selection Guide

ContextRecommended spacingNotes
Compact components (Inline)4–8pxIcon gap, tag inner spacing
List / Table8–12pxRow spacing, cell inner spacing
Section / Container12–16pxCard padding, form area
Page sections24–48pxModule spacing, paragraph spacing
Page level40–72pxAbove-the-fold whitespace, bottom spacing

Responsive Grid

Breakpoint System

BreakpointWidthColumnsGutterMargin
Desktop Standard≥ 1440px1224pxauto
Desktop Compact1024–1439px1220pxauto
Tablet Landscape768–1023px816px24px
Tablet Portrait600–767px416px16px
Mobile< 600px412px16px

Maximum Content Width

  • Desktop Standard — Max content width 1440px, centered
  • Desktop Large — Max content width 1200px, centered

Page Layout

Page layout follows this structure:

  • Fixed top navigation bar, height 64px
  • Left sidebar width 240px (collapsible)
  • Content area fills remaining space
  • Content area horizontal padding 24–48px (responsive)

:::info Layout Principles

  • Content area is always centered within the available space
  • Content area expands automatically when the sidebar is collapsed
  • Sidebar is hidden on mobile, replaced by a hamburger menu :::

Border Radius

TokenValueUsage
radius-22pxSmall elements (tags, badges)
radius-44pxInputs, buttons
radius-55pxDefault component border radius
radius-88pxCards, dropdown menus
radius-1212pxLarge cards, dialogs
radius-1616pxDialogs, overlays
radius-full9999pxPill shape, avatars

Border radius is referenced via CSS variables: border-radius: var(--Radius_5)


Shadows & Elevation

Drop Shadow

LevelParametersUsage
Default0 1px 3px rgba(0,0,0,0.08)Card default state
Emphasized0 4px 12px rgba(0,0,0,0.12)Card hover state, dropdown menus

Layer Shadow

LevelParametersUsage
Layer 10 1px 2px rgba(0,0,0,0.06)Subtle layering
Layer 2 (Elevated)0 4px 16px rgba(0,0,0,0.1)Floating layers, dialogs

Accessibility

Minimum Touch Target

All interactive elements must have a touch target no smaller than 44 × 44px (WCAG 2.1 AA).

Spacing Consistency

Spacing between elements within the same container must be consistent to avoid visual rhythm disruption.

Touch-Friendly

Spacing on mobile should be appropriately increased to ensure comfortable finger interaction.


Design Checklist

Confirm before each design review:

  • All spacing values come from the Spacing Scale (multiples of 4)
  • Border radius uses token references, not hardcoded values
  • Responsive breakpoints correctly follow Grid rules
  • Interactive elements have touch targets ≥ 44px
  • Page layout follows the Grid system
  • Shadow level matches the element's elevation level

Usage

Tailwind Class

// Spacing
<div className="px-16 py-8 gap-8" /> // padding-x: 16px, padding-y: 8px, gap: 8px
<div className="p-24 mb-32" /> // padding: 24px, margin-bottom: 32px

// Border radius
<div className="rounded-[var(--Radius_5)]" />
<div className="rounded-full" /> // Pill shape

// Shadows
<div className="shadow-sm" /> // Default shadow
<div className="shadow-md" /> // Emphasized shadow