Schema
Every DSDS schema definition, on one page: the base document, every entry kind, every section kind, and every shared building block - each with a real, working example next to it.
#
How the schema is organizedThis spec is built from a small, fixed set of building blocks, reused rather than reinvented per file — each definition below documents its own fields directly. See Conformance in the README for how it's all enforced.
Every entry has a
| Kind | Description |
|---|---|
| The design system as a whole — version, organization, url, license, platforms, plus system-wide documentation. | |
| A reusable UI element — buttons, inputs, modals. Carries its own | |
| A single design token. Carries | |
| A named set of token overrides — dark mode, high-contrast, a brand variant. Points at its own DTCG source file. | |
| The generic, open kind for anything else — a foundation, a pattern, a guide. Has no fields beyond what every entry shares. | |
| (custom) | A custom kind like |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@
@@ @@
@@ @@@@@@@@@@@ @@@@@@@@@@ @@
@@ @@ @@ @@ @@ @@
@@ @@ @@ @@ @@
@@ @@ @@ @@@@@@@@@@ @@
@@ @@ @@ @@ @@
@@ @@ @@ @@ @@ @@
@@ @@@@@@@@@@@ @@@@@@@@@@ @@
@@ @@
@@ @@@@@@@@@@@ @@@@@@@@@@ @@
@@ @@ @@ @@ @@ @@
@@ @@ @@ @@ @@
@@ @@ @@ @@@@@@@@@@ @@
@@ @@ @@ @@ @@
@@ @@ @@ @@ @@ @@
@@ @@@@@@@@@@@ @@@@@@@@@@ @@
@@ @@
@@ @@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ #
When a document fails validationThe validator reports two kinds of error. A schema error (printed as
must have required property 'X' . A field the kind requires is missing. Add it.must NOT have additional properties , ormust NOT have unevaluated properties . The field isn't one this kind declares. Usually a typo, or a field from an older version. Remove it, or fix its spelling. Its section on this page has the right name.must be equal to one of the allowed values . The value isn't in the list. Use one of the values the field's section lists.must be equal to constant . A fixed value, such as the one a kind requires, is different. Set it to the value the message gives.must match pattern . The value's format is wrong, such as capitals in an entryid . Change the value to fit the pattern in the message.must be string ,must be object ,must be array . The value has the wrong type. Change it to the type the message names.must NOT have fewer than 1 items . A list is empty. Add an item, or remove the list.must match exactly one schema in oneOf , ormust match "else" schema , ormust match a schema in anyOf . The value fits none of the shapes the field allows, or a conditional requirement isn't met. Compare the value with the field's description on this page, which lists the shapes it accepts.
Base
object
A DSDS document. Acts as the container for all content. Can be optionally extended or split across other DSDS documents.
Min items: 1
Min items: 1
schemaVersion: "0.24.0"
name: Acme Design System
$schema: https://designsystemdocspec.org/v0.24.0/dsds.bundled.yaml
entries:
- id: acme-design-system
kind: system
...
shared:
- id: shared-a11y
...
refs:
- href: ./starter-kit-fragments/button.dsds.yaml
rel: file
$extensions:
com.acme: {...}Shared
object
Reusable content other entries point at instead of restating. Not a design-system artifact in its own right.
Min items: 1
- id: shared-a11y
name: Shared Accessibility Rules
description: Cross-cutting accessibility rules, stated once and referenced from every entry they apply to.
refs:
- href: https://www.w3.org/WAI/WCAG21/quickref/
rel: relates-to
sections:
- kind: guidelines
for: all
items:
- id: touch-target
statement: Minimum touch target 44x44px.
level: must
$extensions:
com.acme: {...}common/
Combo
object
Defines what an element can or cannot be paired with. Relates to traits, tokens, and entries.
Min items: 1
combos:
- subject: "{color.action.primary}"
level: must
items: ["{color.surface.default}", "{color.surface.raised}"]
note: Contrast is verified only against these surfaces; on any other background the label ratio is unproven.common/
target
An entry id, a trait target on this entry, or a token reference wrapped in braces.
size.large # a bare id
"{color.action.primary}" # or a token referencecommon/
traitTarget
string
A boolean trait's id, or
common/
tokenRef
string
A token reference, wrapped in braces.
common/
Example
object
A single example, illustrating something in context.
example:
title: One primary action per surface
description: A toolbar with one filled primary button and two lower-emphasis secondary buttons.
showcase:
kind: image
url: https://cdn.acme.example/ds/showcase/button-primary-surface.png
alt: A toolbar with one filled primary button and two lower-emphasis secondary buttons.
ref:
href: https://storybook.acme.example/?path=/story/button--primary
rel: democommon/
list
array
One or more examples, in order.
- title: One primary action per surface
showcase: {kind: image, url: https://cdn.acme.example/ds/showcase/button-primary-surface.png}
- title: Loading state
ref: {href: ./stories/button.stories.tsx, rel: demo}common/
Extensions
object
Escape hatch for tool data, or for an outside id that doesn't fit this schema's own id pattern. Each top-level key MUST be a dotted namespace, like
Open map: keys are strings, values are
$extensions:
com.acme:
rationale: Multiple primary buttons compete for attention and force the user to guess which action is actually the recommended one.
failureMode: A dialog ships with two primary-styled buttons (e.g. "Save" and "Save as draft"), and usability testing shows users default to the wrong one.common/
Id
string
Lowercase, dash-separated segments, optionally chained with dots. A section item's own
id: color.action.primarycommon/
apiId
string
A single identifier copied verbatim from a real API, in whatever case that API uses.
common/
tokenId
string
The same as
color/action/primarycommon/
namespaced
string
A dotted, namespaced custom value. The open extension point alongside a fixed set of well-known values.
acme.icon-librarycommon/
Markdown
string
Prose written in CommonMark, with GFM tables and fenced code blocks allowed. It can link to something in the project with a
statement: Do not use button when the action navigates to a new URL; use the link entry instead.common/
Ref
A pointer from one thing to another, with
Accepts one of:
- string — A plain outside link, short for `{href: <string>}`.
- object
What kind of pointer this is, or a namespaced custom value. A relationship is written once, on the thing it starts from. A conforming consumer works out the reverse direction itself, and MUST NOT require it to be written on the target as well. Where an object has a field named for a kind of pointer, that kind MUST go in the field, not in refs (DSDS-25).What this points at, inside the project. What this points at, outside the project. A file, a URL or a package. What the target does here. Anything else worth saying about this link.
- href: https://example.atlassian.net/browse/DS-482
rel: relates-to
role: Tracks the two-primary-buttons issue
note: Filed after a usability test surfaced the ambiguity.
# or, pointing inside this document instead of outside it:
- to: shared-a11y#touch-target
rel: same-ascommon/
list
array
One or more pointers, in order, each with its own
- to: getting-started
rel: relates-to
- href: https://storybook.acme.example
rel: democommon/
targets
array
One or more pointers of the kind the field is named for, in order.
checks:
- href: ./tests/button.a11y.test.ts
role: test
- to: release-checklist#focus-visible-checkcommon/
rel
What kind of pointer this is, or a namespaced custom value. A relationship is written once, on the thing it starts from. A conforming consumer works out the reverse direction itself, and MUST NOT require it to be written on the target as well. Where an object has a field named for a kind of pointer, that kind MUST go in the field, not in
Accepts one of:
- string
- namespaced
common/
target
A pointer in a field named for one kind of pointer. It has no
Accepts one of:
- string — A plain outside link, short for `{href: <string>}`.
- object
What this points at, inside the project. What this points at, outside the project. A file, a URL or a package. What the target does here. Anything else worth saying about this link.
# In a field named for one kind of pointer, like a guideline's evidence:
- href: https://www.w3.org/WAI/WCAG22/Understanding/link-purpose-in-context.html
role: WCAG 2.2 SC 2.4.4 (A)
# or, the shorthand for an outside link:
- https://www.w3.org/WAI/WCAG22/Understanding/link-purpose-in-context.htmlcommon/
to
string
What this points at, inside the project.
common/
href
string
What this points at, outside the project. A file, a URL or a package.
common/
role
string
What the target does here.
common/
note
string
Anything else worth saying about this link.
common/
RequirementLevel
string
How strict a rule is, from must to must-not.
Allowed values:
must should may should-not must-not
- statement: Limit each surface to one primary button.
level: should
- statement: Use buttons only for in-page actions, never navigation.
level: mustcommon/
Showcase
A visual sample of something. Can be a media file (image or video) or a link to a live page.
showcase:
kind: image
url: https://cdn.acme.example/ds/showcase/button-primary-surface.png
alt: A toolbar with one filled primary button and two lower-emphasis secondary buttons.
note: Captured from the Storybook build, light theme.common/
Since
string
The version something was introduced in.
since: 1.4.0metadata/
Metadata
object
Optional information about an element.
Min items: 1
Min items: 1
metadata:
tags: [actions, button, cta]
owner: ds@acme.example
reviewed:
- date: 2026-05-01
by: human:ahormati
note: Copy and contrast ratios re-checked; no changes needed.
updated:
date: 2026-06-02
note: Added the loading trait and its guideline.
origin:
method: generated
author: generated
note: Generated from custom-elements.json (CEM schemaVersion 2.1.0) by cem-to-dsds.
$extensions:
com.acme: {...}metadata/
note
string
A plain-text note. MUST NOT contain markup.
Reviewed against the latest Figma file; no changes needed.metadata/
isoDate
string
An ISO 8601 date (YYYY-MM-DD).
2026-06-02metadata/
EntryMetadata
object
Information about a single entry, on top of the fields every metadata object shares.
Min items: 1
Min items: 1
metadata:
status: {status: stable}
since: 1.4.0
group: color.action
aliases: [btn]
tags: [actions, button, cta, form-control]
owner: ds@acme.example
reviewed:
- date: 2026-05-01
by: human:ahormati
updated: {date: 2026-06-02, note: Added the loading trait and its guideline.}
origin: {method: authored, author: human}
preview: {kind: image, url: https://cdn.acme.example/ds/showcase/button.png}
$extensions:
com.acme: {...}metadata/
status
A lifecycle status, optionally scoped to one platform - or a list of them, one per platform, when an entry has reached different maturity on each.
Accepts one of:
- statusEntry
statusEntry []
metadata/
statusEntry
One lifecycle status, optionally scoped to a single platform.
metadata/
statusValue
string
A lowercase, dash-separated lifecycle word, for example "stable" or "deprecated".
stablemetadata/
SystemMetadata
object
Information about the design system as a whole, on top of the fields every metadata object shares.
Min items: 1
Min items: 1
Min items: 1
metadata:
version: 1.4.0
organization: Acme Corp
url: https://design.acme.example
license: MIT
platforms: [react, web-component]
tags: [design-system]
owner: ds@acme.example
reviewed:
- date: 2026-05-01
by: human:ahormati
updated: {date: 2026-06-02}
origin: {method: authored, author: human}
$extensions:
com.acme: {...}entries/
Entry
object
The structure every entry kind shares:
Pattern:
Min items: 1
id: empty-state
kind: entry
name: Empty State
description: Composition of components shown when a view has no content to display yet. Tells the user why an area is empty and what to do next.
metadata:
status: {status: stable}
uses:
- to: button
extends:
- to: base-dialog
alternatives:
- to: error-state
refs:
- href: https://github.com/acme/ds/tree/main/patterns/empty-state
rel: source
sections:
- kind: guidelines
for: all
items:
- statement: Use an empty state the first time a list or grid has no content.
level: should
$extensions:
com.acme: {...}entries/
dispatch
Routes an entry to its own kind-specific schema by
- id: empty-state
kind: entry
name: Empty State
description: Composition of components shown when a view has no content yet.
- id: button
kind: component
...entries/
ComponentEntry
object
A reusable UI element, like a button or a dialog.
Pattern:
Min items: 1
Min items: 1
Min items: 1
Min items: 1
Min items: 1
id: button
kind: component
name: Button
description: Triggers an action. Gives users a single, consistent way to trigger an action.
metadata: {status: {status: stable}}
uses: [{to: color.action.primary}]
extends: [{to: base-dialog}]
alternatives: [{to: link}]
refs: [{href: https://github.com/acme/ds/react/button, rel: source}]
sections:
- kind: guidelines
for: all
items: [{statement: Limit each surface to one primary button., level: should}]
$extensions:
com.acme: {...}
sourceFiles:
- platform: react
file: ./src/Button.tsx
imports:
- platform: react
code: "import { Button } from '@acme/ui';"
package: "@acme/ui"
traits:
- traitType: state
kind: boolean
id: loading
description: Shows a spinner in place of the label and blocks interaction while active.
combos:
- subject: loading
level: must-not
items: [disabled]
note: A control can't be simultaneously loading and disabled...
specs:
- href: ./contracts/button.contract.json
role: DS Contractsentries/
traitType
string
Whether this trait is a variant the caller configures, or a state the component can be in.
Allowed values:
variant state
entries/
traitValue
object
The shared properties of a boolean trait or one enum value - what it is, and what it's for.
id: loading
name: Loading
description: Shows a spinner in place of the label and blocks interaction while active, so an action can't be submitted twice.
examples:
- title: Default loading state
showcase: {kind: image, url: https://cdn.acme.example/ds/showcase/button-loading.png}
since: 1.4.0entries/
SystemEntry
object
A DSDS design system. System-level information and guidance for the design system as a whole.
Pattern:
Min items: 1
id: acme-design-system
kind: system
name: Acme Design System
description: Acme's cross-platform design system. One source of truth for how Acme builds and documents interfaces.
metadata:
version: 1.4.0
organization: Acme Corp
url: https://design.acme.example
license: MIT
platforms: [react, web-component]
status: {status: stable}
extends: [{to: base-design-system}]
uses: [{to: button}]
refs: [{to: acme-brand-system, rel: relates-to}]
sections:
- kind: section
for: all
title: Getting started
freeform: [{title: Install, body: Add the package and its peer dependencies.}]
$extensions:
com.acme: {...}entries/
ThemeEntry
object
A defined system theme.
Pattern:
Min items: 1
Default:
id: dark
kind: theme
name: Dark
description: Inverted-luminance theme for low-light surfaces and user preference. Lets a product opt into a dark color scheme without redefining every token.
metadata: {status: {status: stable}}
extends:
- to: light
refs:
- href: https://www.figma.com/file/acme-dark-theme
rel: design
sections:
- kind: guidelines
for: all
items: [{statement: Test contrast against both themes before shipping., level: should}]
$extensions:
com.acme: {...}
source: tokens/dark.tokens.json
colorScheme: darkentries/
TokenEntry
object
A single design token, from the Design Tokens Community Group (DTCG) format.
Pattern:
Min items: 1
Pattern:
Min items: 1
id: space-4
kind: token
name: Space 4
description: A single step on the base spacing scale - 4 times the 4px base unit. Keeps spacing consistent across components without hand-picked pixel values.
metadata: {status: {status: stable}, group: space}
extends: [{to: space-base}]
alternatives: [{to: space-8}]
refs: [{href: https://www.figma.com/file/acme-spacing-scale, rel: design}]
sections:
- kind: guidelines
for: all
items: [{statement: Use for default padding/gap; use space-8 for section spacing., level: should}]
$extensions:
com.acme: {...}
tokenType: spacing
source: ./tokens.dtcg.json
combos:
- subject: "{color.action.primary}"
level: must
items: ["{color.surface.default}", "{color.surface.raised}"]sections/
Section
object
A logical documentation section. Supplies the fields every section kind shares, in declaration order —
Default:
Min items: 1
Min items: 1
- kind: section
for: all
title: Troubleshooting
description: Common problems and how to fix them.
context: acme.troubleshooting
items:
- title: Note
body: Generic items have no fixed fields - use freeform for prose instead.
freeform:
- title: Styles don't apply
body: Confirm the base theme is imported before any component renders - a component's own CSS assumes the theme's custom properties already exist.
$extensions:
com.acme: {...}sections/
dispatch
Routes a section to its own kind-specific schema by
- kind: guidelines
for: all
items:
- statement: Limit each surface to one primary button.
level: should
- kind: steps
...sections/
freeformEntry
object
One nestable, headed block of prose - a freeform section's own building block.
Min items: 1
title: Install
id: install
body: Add the package and its peer dependencies.
examples:
- title: Install with the CLI
ref: {href: ./install.sh, rel: file}
refs:
- to: getting-started
rel: relates-to
items:
- title: Peer dependencies
body: React 18+ and a theme provider higher in the tree.
$extensions:
com.acme: {...}sections/
DefinitionsSection
object
Term definitions. Can describe content labels within components or patterns, define naming conventions, act as a glossary, or be a simple way to outline component props/APIs.
Default:
Min items: 1
Min items: 1
Min items: 1
- kind: definitions
for: all
title: Terms
description: Words used in this component's copy.
context: terms
items:
- term: OK
definition: To confirm an action.
- term: Cancel
definition: To cancel an action.
freeform:
- title: About
body: These terms match the ones used in product copy guidelines.
$extensions:
com.acme: {...}sections/
definitionItem
object
One term - a name paired with what it means, or a pointer to where that's really stated.
Min items: 1
term: OK
definition: To confirm an action.sections/
ExamplesSection
object
Worked examples of an entry, each one a named instance: a screenshot, a recording, a live story, or a short written walkthrough.
Default:
Min items: 1
Min items: 1
Min items: 1
- kind: examples
for: all
title: In use
description: How the button looks and behaves in real screens.
items:
- id: button-loading
title: Button while saving
description: The label is replaced by a spinner, and the button ignores clicks until the save finishes.
showcase:
kind: image
url: https://cdn.acme.example/ds/showcase/button-loading.png
alt: A primary button showing a spinner in place of its label.
ref:
href: https://storybook.org/ds/button?path=/story/button--loading
rel: demosections/
exampleItem
One named example of the entry in use.
id: button-loading
title: Button while saving
description: The label is replaced by a spinner, and the button ignores clicks until the save finishes.
showcase:
kind: image
url: https://cdn.acme.example/ds/showcase/button-loading.png
alt: A primary button showing a spinner in place of its label.
ref:
href: https://storybook.org/ds/button?path=/story/button--loading
rel: demo
uses:
- to: color.action.primarysections/
GuidelinesSection
object
Rules for an entry. When and how to use it. Each item pairs a rule with why it exists. When an item carries a
Default:
Min items: 1
Min items: 1
Min items: 1
Default:
- kind: guidelines
for: agent
framing: when-to-use
title: When to use
description: Whether button is the right choice for this action.
context: acme.fit-check
items:
- statement: Do not use button when the action navigates to a new URL; use the link entry instead.
level: must-not
alternatives:
- to: link
freeform:
- title: Why this matters
body: A button that navigates breaks browser back/forward and "open in new tab."
$extensions:
com.acme: {...}sections/
guidelineItem
object
One guideline - a rule paired with why it exists, or a pointer to where it's really stated.
Min items: 1
Constraints: at least one of:
statement must be presentrefs must be present
level: must
statement: Give an icon-only button an accessible name that matches its visible tooltip.
checks:
- href: ./tests/button.a11y.test.ts
role: test
note: vitest + axe-core
checkedBy: programmatic
tags: [accessibility, naming]sections/
StepsSection
object
A series of actions/steps/tasks, like a tutorial, a migration, a pattern's interaction flow, or checklist of things to verify.
Default:
Min items: 1
Min items: 1
Min items: 1
Default:
- kind: steps
for: agent
ordered: false
title: Pre-release checklist
description: Run through before shipping a change to this component.
context: acme.checklist
items:
- title: Focus ring is visible in both light and dark themes.
- title: Loading state announces to screen readers.
- title: Works with a custom icon in the leading-icon slot.
optional: true
freeform:
- title: Why this matters
body: Skipping this checklist is how contrast regressions ship.
$extensions:
com.acme: {...}sections/
stepItem
object
One step or checklist entry - a title paired with what to do, or a pointer to where that's really stated.
Default:
title: List loads with zero results
description: When a filter or search narrows the results to zero, the empty state renders in place of the list, with a heading, body text, and (if applicable) a primary action.
uses:
- to: button
role: Clears the filter or starts the relevant action.