Foundations

Tokens

Roles, scoped colours, and component measurements

import { role, type, motion, shadow, appearance } from "@nyte-ai/ui/styles/vars.stylex";
import { button, radius } from "@nyte-ai/ui/styles/schema.stylex";
import { surfaceTheme, intent } from "@nyte-ai/ui/surface-theme";

Use colour roles inside scopes, component handles for controls, and radius names for rounded containers. Ramps, theme mappings, and size values are private.

Usage

import { create, props } from "@stylexjs/stylex";
import { role, type } from "@nyte-ai/ui/styles/vars.stylex";
import { radius } from "@nyte-ai/ui/styles/schema.stylex";
import { intent } from "@nyte-ai/ui/surface-theme";

const styles = create({
  status: {
    color: role.contentSecondary,
    backgroundColor: role.bgInteractiveSecondaryTranslucent,
    borderRadius: radius.control,
    fontSize: type.fontBase,
  },
});

export function Status() {
  return <span {...props(intent.success, styles.status)}>Saved</span>;
}

The default scope is neutral gray. surfaceTheme.gray applies tinted roles over gray, and surfaceTheme.custom takes its hue from --nyte-custom-hue and --nyte-custom-chroma-scale. Other scopes are brown, orange, yellow, green, blue, purple, pink, red, and teal.

Colour useScopeRole
Status textintent.success, intent.warning, or intent.dangercontentSecondary
Filled actionintent.primarybuttonFill and contentOnInteractiveStrong
Syntax tokenA hue per token kindcontentSecondary
Dot, file glyph, chart seriesA hue per categorycontentInteractiveTertiary
Added diff line or wordsurfaceTheme.greenbgInteractiveSecondaryTranslucent or bgInteractivePrimaryTranslucent
Removed diff line or wordsurfaceTheme.redThe same background roles
AvatarA hue per avatarbgInteractiveSecondaryTranslucent and contentInteractivePrimary

Apply a scope with props(surfaceTheme.blue, styles.item). Scope the list when every item shares a hue.

Layers

KindOrderConsumer API
ColourRamps → theme → neutral or tinted rolesrole
SizeValues → components → app layoutbutton, input, switchControl, checkbox, row, menu, dialog, toast, glyph, clipboardPreview, radius
TypeFont inputs and derived type scaletype
MotionDurations and easingmotion
ShadowSize values and shadow inks → elevationshadow
AppearanceDisplay, pointer, transparency, and focus inputsappearance

radius has five names: indicator, control, card, surface, and pill. Component radii stay on their component handles. Component sizes grow under (pointer: coarse).

Roles resolve through light-dark(), so color-scheme on an ancestor picks the appearance. The focus ring ignores hue scopes.

Readable text uses contentPrimary or contentSecondary. contentTertiary is for placeholders, disabled hints, and decoration. Glyphs use contentInteractiveTertiary or a stronger role.

Import handles instead of writing var(--nyte-…). Use a design-scale literal when no handle exists.

Native colours

import { platformColors, platformScopes } from "@nyte-ai/ui/platform-colors";

const page = platformColors.light.bgBase;
const status = platformScopes.light.green.contentSecondary;

Native colours contain resolved values for each appearance. Use a scope and role instead of a fixed status or syntax colour.

Compiled styles

Without a StyleX compiler, load the package stylesheet.

@import "@nyte-ai/ui/ui.css";