Skip to main content
Mantı UI logoMantı UIv0.12.1
Studio

Color & variants

Manti UI separates fixed color ramps from the semantic roles components use.

Primitive ramps

Six OKLCH ramps run from 1 (lightest) to 12 (darkest):

RampPurposeUse it for
grayNeutral UISurfaces, borders, text, and secondary controls
orangePrimaryMain actions, selected states, and the product accent
greenSuccessPositive feedback, completed states, and confirmations
blueInformationInformational feedback, notices, and helpful context
amberWarningCaution, attention, and states that need review
redDangerErrors, destructive actions, and critical feedback

gray

1
2
3
4
5
6
7
8
9
10
11
12

orange

1
2
3
4
5
6
7
8
9
10
11
12

green

1
2
3
4
5
6
7
8
9
10
11
12

amber

1
2
3
4
5
6
7
8
9
10
11
12

red

1
2
3
4
5
6
7
8
9
10
11
12

blue

1
2
3
4
5
6
7
8
9
10
11
12

Each stop is available as --manti-{ramp}-{step}. Component CSS should use semantic tokens or variants instead of choosing a stop directly.

Primitive scale contract

This mapping comes directly from colorScaleRoles in @manti-ui/tokens. Every color ramp uses the same contract:

StopSource roleExact purpose
1appBackground[0]Lighter page or panel background position
2appBackground[1]Next page or panel background position
3componentBackground.restResting component background
4componentBackground.hoverHovered component background
5componentBackground.activeActive, pressed, or selected component background
6border.subtleSubtle borders and separators
7border.interactiveInteractive borders
8border.strongStrong borders and focus chrome
9solid.restResting solid fill
10solid.hoverHovered solid fill
11text.lowContrastSupporting or lower-contrast text
12text.highContrastPrimary or highest-contrast text

This is the palette's intended role contract, not a promise that every component reads the primitive stop literally. Components consume semantic tokens or --variant-* roles, and tokens.css adapts them for theme and contrast.

The current --variant-solid* mappings are:

VariantRestHoverActive
primaryorange-7theme-aware color-mix()theme-aware color-mix()
success, info, and dangermatching hue at step 8theme-aware color-mix()theme-aware color-mix()
secondarygray-11 / gray-3gray-10 / gray-4gray-9 / gray-5
tertiary and outlinesemantic neutral valuesemantic neutral valuesemantic neutral value

Values separated by / mean light theme / dark theme. These mappings deliberately depart from the nominal 9 → 10 solid pair when contrast requires it.

Input-like controls are the main exception to the colored-border progression. They use the neutral border at rest and hover, then introduce the variant color at focus or open.

Built-in variants

Manti ships seven variant palettes:

  • primary — orange, highest emphasis;
  • secondary — neutral soft surface;
  • success — green feedback;
  • info — blue feedback;
  • tertiary — neutral ghost;
  • danger — red feedback;
  • outline — neutral bordered treatment.

Individual components may expose a subset. Alert supports primary, secondary, success, info, and danger. Badge omits tertiary. Button also adds link.

Every variant defines the same roles:

--variant-solid
--variant-solid-hover
--variant-solid-active
--variant-on-solid
--variant-soft-bg
--variant-soft-bg-hover
--variant-soft-bg-active
--variant-soft-text
--variant-border
--variant-text
--variant-ring

Custom variant

Components typed with MantiVariant accept custom strings:

[data-variant='brand'] {
  --variant-solid: var(--manti-blue-9);
  --variant-solid-hover: var(--manti-blue-10);
  --variant-solid-active: color-mix(in oklab, var(--manti-blue-10) 88%, black);
  --variant-on-solid: var(--manti-text-on-accent);
  --variant-soft-bg: var(--manti-blue-2);
  --variant-soft-bg-hover: var(--manti-blue-3);
  --variant-soft-bg-active: var(--manti-blue-4);
  --variant-soft-text: var(--manti-blue-9);
  --variant-border: var(--manti-blue-7);
  --variant-text: var(--manti-blue-9);
  --variant-ring: var(--manti-blue-8);
}
<Button variant="brand">Save</Button>

Contributor checks

Use semantic roles in component CSS, keep foregrounds explicit, and verify both themes:

pnpm check:color-scale
pnpm --filter @manti-ui/styles check:contrast
pnpm --filter @manti-ui/styles build

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub