Joyce Doan / Writing
Mar 2026 · 14 min read

Design System Markdown Template

A practical template for documenting UI components, styles, and guidelines — from color tokens to component rules.

This template is used to document and maintain a design system — covering tokens, components, and rules. Duplicate this for each new product and fill in your values.

Download Markdown Template →

Overview

ReferenceFigma / Storybook link
TechnologyFramework name

Foundation packages: Colors, Typography, Spacing, Radius, Patterns

Component packages: List your component libraries here


1. Foundations

Color System

Color Scale: [FRAMEWORK NAME] FULL NAMES
Use this scale for all token names (50–950 range).

Primary

TokenLightDark
primary-50
primary-100
primary-200
primary-300
primary-400
primary-500
primary-600
primary-700
primary-800
primary-900

Neutral (Gray)

TokenLightDark
gray-50
gray-100
gray-200
gray-300
gray-400
gray-500
gray-600
gray-700
gray-800
gray-900

Semantic Colors

Background Colors

SemanticMeaningLightDark
bg-pageRoot page background
bg-surfaceCards, panels
bg-overlayDropdowns, tooltips
bg-modalModal backdrop

Text Colors

SemanticMeaningLightDark
text-brightHeadings, emphasis
text-primaryDefault body text
text-secondarySupporting text
text-disabledInactive elements
text-inverseOn dark backgrounds
text-accentLinks, highlights

Border Colors

SemanticMeaningLightDark
border-subtleDividers, quiet edges
border-defaultInputs, cards
border-strongFocus rings, emphasis

Fonts

  • Always insert your font imports here
  • Reference: font-primary, font-mono

Typography

Font Family

RoleFont
Primarye.g. Poppins, Inter
Monoe.g. JetBrains Mono

Font Weights

NameValue
Bold700
Semibold600
Medium500
Regular400

Typography Scale

Heading

TokenSizeLine HeightWeightLetter SpacingUsage
h1
h2
h3
h4

Subtitle

TokenSizeLine HeightWeightLetter SpacingUsage
subtitle-lg
subtitle-sm

Body

TokenSizeLine HeightWeightLetter SpacingUsage
body-lg
body-md
body-sm

Caption

TokenSizeLine HeightWeightLetter SpacingUsage
caption

Label

TokenSizeLine HeightWeightLetter SpacingUsage
label

Button Text

TokenSizeLine HeightWeightLetter SpacingUsage
btn-lg
btn-md
btn-sm

Overline (Optional)

TokenSizeLine HeightWeightLetter SpacingUsage
overline

Spacing

TokenSizeValue
space-000px
space-114px
space-228px
space-3312px
space-4416px
space-5520px
space-6624px
space-8832px
space-101040px
space-121248px
space-161664px
space-202080px
space-242496px

Border Radius (Rounded Corners)

TokenSizeValueUsage
radius-none00pxSharp corners
radius-smsm4pxSmall elements
radius-mdmd8pxButtons, inputs
radius-lglg12pxCards, panels
radius-xlxl16pxLarge cards
radius-2xl2xl24pxModals
radius-fullfull9999pxPills, chips

Shadow (Elevation)

NameLightDark
shadow-sm
shadow-md
shadow-lg
shadow-xl

Border

NameLightDark
border-subtle
border-default
border-strong

2. Components

Button

  • Primary — bg: primary-700, text: text-inverse
  • Secondary — bg: bg-surface, border: border-default
  • Disabled — opacity: 0.4
  • Ghost — bg: transparent, text: text-primary

Divider: border-subtle horizontal / vertical

Sizes:

SizeHeightPaddingFont
sm32px0 12pxbtn-sm
md40px0 16pxbtn-md
lg48px0 20pxbtn-lg

Input

  • Background: bg-surface
  • Border: border-default → focus border-strong
  • Text: text-primary
  • Placeholder: text-disabled
  • Label: label token

Card

  • Background (default): bg-surface
  • Shadow: shadow-sm
  • Border: border-subtle
  • Border radius: radius-lg

Badge

  • Background (default): bg-surface
  • Text: text-secondary
  • Radius: radius-full

Table

  • Background: bg-page
  • Header: bg-surface
  • Row hover: bg-surface
  • Divider: border-subtle

  • Background: bg-surface
  • Overlay: bg-overlay at 60% opacity
  • Border radius: radius-xl

3. Background System

LevelTokenLightDark
0bg-page
1bg-surface
2bg-overlay
3bg-modal

4. Accessibility

  • Contrast: all body text must meet WCAG AA (4.5:1 minimum)
  • Focus: always visible — never outline: none without a replacement ring
  • Motion: wrap transitions in prefers-reduced-motion — drop to 0ms
  • Color: never use color as the only signal (pair with icon or text)
  • Touch targets: minimum 44×44px on mobile

5. Rules

  1. No magic numbers — every value traces to a token
  2. Tokens over classes — components consume tokens, not hardcoded values
  3. One source of truth — Figma is intent, code is implementation; reconcile every sprint
  4. Components are context-agnostic — layout is the parent’s responsibility
  5. Dark mode is not a feature — test every token in both modes before shipping
  6. Document the why — comments explain constraints, not what the code does
  7. Deprecate before deleting — give one sprint cycle to migrate before removing tokens or components
Share
Next → Token-Efficient Design Context