Skip to content

Design reference

DesignReference renders your whole design system from your config, using yarcl components: colors with their contrast ratios, the size scale with live controls, radii, variants, spacing, shadows, fonts, text styles, heading levels, density, the remaining tokens and every default.

import { DesignReference } from 'yarcl/reference';
<DesignReference title="Acme design system" />

Add it to an internal route, a Storybook page or your docs, and it stays accurate because it reads the same config your app uses.

This is the reference for the config of this documentation site:

yarcl docs design system

Colors

Semantic colors for the color prop. Ratios are foreground on background, light / dark.

Aa
primary#2d4bb8 / #8aa2ff7.5:1 / 8.7:1
Aa
neutral#4b5263 / #a3a9b87.8:1 / 8.9:1
Aa
success#15803d / #4ade805.0:1 / 12.1:1
Aa
warning#b45309 / #fbbf245.0:1 / 12.6:1
Aa
danger#dc2626 / #f871714.8:1 / 7.6:1
Aa
info#0369a1 / #38bdf85.9:1 / 9.8:1

Neutrals

Backgrounds, text and borders.

bg#ffffff / #17181c
surface#ffffff / #23262f
text#23262f / #e6e8ee
muted#5e6575 / #9aa1b1
border#d8dbe3 / #353a47

Sizes

One scale shared by every control, so controls of the same size line up.

Control sizes
SizeHeightPadding XFontIconPreview
xs1.75rem0.625rem0.75rem0.75rem
sm2rem0.75rem0.8125rem0.875rem
md2.5rem1rem0.875rem1rem
lg3rem1.25rem1rem1.25rem
xl3.5rem1.5rem1.125rem1.5rem

Radii

Default radius: md.

square0
sm0.25rem
md0.375rem
lg0.5rem
xl0.75rem
rounded9999px

Variants

Recipes applied on top of any color.

solidbackground fill, border color, text on
softbackground tint, border none, text color
outlinebackground none, border color, text color
ghostbackground none, border none, text color

Spacing

xs
0.25rem
sm
0.5rem
md
1rem
lg
1.5rem
xl
2rem

Shadows

sm
md
lg

Typography

Families
sansThe quick brown fox system-ui, -apple-system, "Segoe UI", Roboto, sans-serif
monoThe quick brown fox ui-monospace, "SF Mono", Menlo, Consolas, monospace
Text styles
displayThe quick brown foxsans · 2.25rem · 800 · 1.1 · -0.02em
headingThe quick brown foxsans · 1.5rem · 700 · 1.25 · -0.01em
subheadingThe quick brown foxsans · 1.125rem · 600 · 1.35
bodyThe quick brown foxsans · 1rem · 400 · 1.5
captionThe quick brown foxsans · 0.8125rem · 400 · 1.4
codeThe quick brown foxmono · 0.875rem · 400 · 1.5
labelThe quick brown foxsans · 0.875rem · 500 · 1.4
Heading levels
h1display
h2heading
h3subheading
h4subheading
h5label
h6label

Modal sizes

Widths of dialogs and drawers.

Modal sizes
sm24rem
md32rem
lg48rem
xl64rem
full100vw

Density

Table density
compact0.25rem 0.5rem · 0.8125rem
comfortable0.625rem 0.75rem · 0.875rem

Other tokens

Layers, motion, borders and focus
zIndex.dropdown1000
zIndex.tooltip1100
zIndex.dialog1200
zIndex.toast1300
motion.fast120ms
motion.base200ms
motion.easingcubic-bezier(0.2, 0, 0, 1)
borders.width1px
focusRing2px · offset 2px · primary

Defaults

Values used when a component prop is omitted: the prop, then an enclosing group, then component defaults, then global defaults.

Component defaults
Drawersize: sm
Global defaults
sizemd
radiusmd
colorprimary
variantsolid
errorColordanger
textStylebody
labelStylelabel
helperStylecaption
gapmd
paddinglg
floatingShadowmd
densitycomfortable
softVariantsoft
modalSizemd