Chip
<Chip> is the design guide's chip idiom, packaged as a component
— the same badge you see as the topbar's DEV indicator, the version
chips, and inline status chips.
It is available in every MDX page without an import (part of the
MDX component map), and exported from the
library root for use in custom components.
Implementing badges
Every chip in the shell shares one typographic core. If you are
building a badge — in a custom component, a consuming site, or another
DreamLake surface — this is the spec, and <Chip> renders it exactly:
| Property | Value |
|---|---|
| Font | var(--font-doc-template-mono) |
| Size / weight | 10px / 600 |
| Tracking | 0.08em, line-height: 1.4 |
| Casing | uppercase |
| Padding / radius | 2px 7px / 4px |
| Border | 1px solid color-mix(in srgb, currentColor 45%, transparent) — a hairline of the text color |
| Layout | inline-flex, vertically centered |
The three variants pick the text / fill pair from the theme tokens, so they work in both modes:
| Variant | Text | Fill | Use for |
|---|---|---|---|
muted (default) | --color-doc-template-muted | --color-doc-template-chip | Neutral labels, absent states. |
accent | --color-doc-template-accent | --color-doc-template-accent-soft | Positive / active states. |
warn | --color-doc-template-warn | --color-doc-template-warn-soft | Caution, in-progress, dev-only. |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'muted' | 'accent' | 'warn' | 'muted' | The text / fill color pair. |
onClick | () => void | — | When set, renders a <button type="button"> with a pointer cursor instead of a <span>. |
title | string | — | Native tooltip. |
className, style | — | — | Pass through; inline style wins over the base + variant styles, so one-off recolors are plain overrides. |
| …rest | button attributes | — | aria-* and any other button/span attributes are forwarded. |
Custom colors
For a color outside the three variants, override via style — the
border is currentColor-derived, so it follows automatically:
This is exactly how the shell's own
TestStatus badge gets its data-driven
pass/fail/skip colors — it renders through <Chip> with style
overrides.
Injecting badges
Three injection points, in order of how structural they are:
1. Topbar version chips (config)
The chips after the brand cluster come from the
versionChips config field — one
{ label, version, dropdown? } entry per chip; dropdown: true makes
it the version switcher:
See Topbar for where they render and Releases & versioning for the manifest behind the dropdown.
2. Standalone VersionBadge (component)
VersionBadge — the two-segment [ label | v0.2.5 ] chip — is
exported from the library root, so the version switcher can live
outside the topbar (a custom footer, a landing hero):
Its segments follow the chip spec above; only the two-segment layout is bespoke.
3. Inline in MDX (content)
<Chip> is registered in the MDX component map, so any page on any
dockit site can drop a badge into prose with no import:
The legacy importer is deprecated as of 0.3.
For badges whose content is data, the worked example is
<TestStatus> — the inline test-status chip from the lakeshore docs.
An MDX page injects it with just an id, and the chip fetches its state
from a CI-generated /test-results.json:
It degrades gracefully — a muted unknown chip when the id (or the
manifest) doesn't exist, as on this site. See
StatusTable for the full data pipeline.
Site-specific badge components follow the same route: build them on
<Chip> and register them via the mdxComponents
config field so your pages can use them without
imports.
Badges the shell already owns
Don't recreate these — they render automatically:
- DEV badge — the warn
DEVchip in the topbar actions cluster while hidden pages are revealed (Cmd+Shift+D); clicking it turns the toggle off. See Topbar. - Git-hash chip — set
gitHashin the site config and a mono commit-hash chip renders after the version chips. - Sidebar
draftchip — the "awaiting review" marker from thedraftfrontmatter flag.