Color

Use color swatches to document Plandalf palette values, tokens, and theme-aware pairs.

Color blocks make design tokens copyable and inspectable.

Compact variant

Use Color.Item when porting Mintlify-style MDX. The compound alias maps to Plandalf’s swatch component.

<Color variant="compact">
  <Color.Item name="blue-500" value="#3B82F6" />
  <Color.Item name="blue-600" value="#2563EB" />
  <Color.Item name="blue-700" value="#1D4ED8" />
  <Color.Item name="blue-800" value="#1E40AF" />
</Color>

Table variant

Use Color.Row to group related colors in a table-style palette.

Primary

Secondary

<Color variant="table">
  <Color.Row title="Primary">
    <Color.Item name="primary-500" value="#3B82F6" />
    <Color.Item name="primary-600" value="#2563EB" />
    <Color.Item name="primary-700" value="#1D4ED8" />
  </Color.Row>
  <Color.Row title="Secondary">
    <Color.Item name="secondary-500" value="#8B5CF6" />
    <Color.Item name="secondary-600" value="#7C3AED" />
  </Color.Row>
</Color>

Color formats

The component supports CSS color formats such as hex, rgb, rgba, hsl, and oklch.

Theme-aware colors

Pass { light, dark } when a token has light and dark mode values.

<Color variant="compact">
  <Color.Item name="bg-primary" value={{ light: "#FFFFFF", dark: "#000000" }} />
  <Color.Item name="bg-secondary" value={{ light: "#F9FAFB", dark: "#0A0A0A" }} />
  <Color.Item name="text-primary" value={{ light: "#111827", dark: "#F9FAFB" }} />
</Color>

Plandalf palette example

Plandalf docs palette
<Color title="Plandalf docs palette">
  <ColorItem name="Primary teal" value="#0f766e" />
  <ColorItem name="Aqua surface" value="#ecfeff" />
  <ColorItem name="Charcoal" value="#171717" />
  <ColorItem name="Theme pair" value={{ light: "#ffffff", dark: "#0a0f0e" }} />
</Color>

Palette groups

Use a palette group when a page documents a family of tokens. Keep the group title specific so the color values are searchable.

Offer surfaces
Status tones
<Color title="Offer surfaces">
  <ColorItem name="Surface" value="#ffffff" />
  <ColorItem name="Soft aqua" value="#edf7f5" />
  <ColorItem name="Border" value="#d6e8e5" />
  <ColorItem name="Text" value="#171717" />
</Color>

Theme-aware pairs

Pass { light, dark } when the token has a light and dark value. The swatch splits into two halves and copies both values.

Theme-aware tokens
<Color title="Theme-aware tokens">
  <ColorItem name="Canvas" value={{ light: "#f8fffd", dark: "#08110f" }} />
  <ColorItem name="Accent" value={{ light: "#0f766e", dark: "#5eead4" }} />
</Color>

Single swatches

You can render Color itself as an item when you only need one value inside another component or example.

<Color name="Primary action" value="#0f766e" />
<Color name="Glass border" value={{ light: "#d6e8e5", dark: "#29413f" }} />

Authoring rules

Color usage

Use exact valueshex or token value

Show the value a reader can copy into code. Avoid vague labels such as “teal-ish” or “brand blue”.

Group by jobpalette section

Group values by surface, status, theme pair, or component state rather than dumping every token into one long list.

Prefer real Plandalf tokensproduct truth

Use Plandalf’s cool glass palette for docs examples. Do not introduce unrelated decorative palettes in docs.

Properties

Color

variantcompact | tabledefault: compact

Display style for the color palette. Use compact for grid swatches and table for grouped rows.

childrenColor.Item | Color.Rowrequired

Color items or color rows to display inside the palette.

Color.Row

titlestringrequired

Label for a row of related colors.

childrenColor.Itemrequired

Color items displayed in the row.

Color.Item

namestringrequired

Name or label for the color.

valuestring | { light: string; dark: string }required

Copyable CSS color value, or a theme-aware pair with light and dark values.

Plandalf extensions

titlestring

Palette heading when Color wraps several ColorItem children.

namestring

Renders Color itself as a single swatch item when paired with value.

class | classNamestring

Adds a class to the palette, row, or item for rare layout-specific cases.

Feature detail