Skip to main content
Neural Nativev0.1.0-beta.1Documentation

What a token changes

NeuTokens exposes 28 theme properties. NeuThemeComponent also derives 45 CSS variables from the resolved theme. The properties and variables are two ways to consume the same design decisions, not independent token catalogs. Use Partial<NeuTokens> to override only the properties you need.

Tokens affect the components and styles that consume them. They are not a universal override of every native primitive. For example, spacing controls Card padding and your own styles that use --neu-spacing; it does not replace all fixed gaps and padding throughout the library.

Color tokens: exact default values

All color properties are strings. These are the light and dark defaults shipped with Neural Native 0.1.0. Override semantic pairs together and review text contrast in both modes.

TokenLightDarkPurpose
accent#006ee6#b5c4ffPrimary actions and selected states.
onAccent#ffffff#172955Text and icons on an accent background.
surface#ffffff#1b2230Cards and control backgrounds.
canvas#f4f5f7#111722The background of the theme container.
text#172033#edf1faPrimary text and labels.
muted#596477#b4bed0Secondary text, hints and placeholders.
border#a5afbf#6c7a92Functional outlines for inputs and other controls.
tonal#eff6ff#293756Soft background for tonal actions.
danger#dc2626#ffb4abErrors and destructive feedback.
success#15803d#8fdeb1Positive status and confirmation.
warning#f59e0b#efd48fWarnings that need attention.
warningText#92400e#efd48fReadable warning text on transparent or tonal buttons.
onWarning#111827#111722Text and loading indicators on a solid warning button.
info#0064d1#7dd3fcInformational messages and actions.

Style variables use the --neu- prefix: --neu-accent, --neu-surface, --neu-canvas, --neu-text, --neu-muted, --neu-border, --neu-tonal, --neu-danger, --neu-success, --neu-info and --neu-warning. The camel-case onAccent property becomes --neu-on-accent.

Semantic text, surfaces and image viewers

These optional NeuTokens properties are also part of the public theme API. The default objects supply surface and image-viewer values. When a semantic text override is omitted, the library resolves a readable text color for that tone.

PropertyLightDarkPurpose
accentTextAutomaticAutomaticReadable brand text; automatically resolved when omitted.
dangerTextAutomaticAutomaticReadable destructive text; automatically resolved when omitted.
successTextAutomaticAutomaticReadable success text; automatically resolved when omitted.
infoTextAutomaticAutomaticReadable informational text; automatically resolved when omitted.
surfaceBorder#e1e6ed#354052Decorative surface outlines, independent of control borders.
divider#e7ebf0#303b4cSeparators between related content.
surfaceSecondary#eef1f5#222d3fSecondary surfaces within a layout.
mediaCanvas#111722#111722Full-screen image canvas, independent of the application color scheme.
mediaText#edf1fa#edf1faReadable image-viewer controls over the media canvas.
mediaBarStylelightlightSystem-bar foreground for the image viewer: light or dark.

Dimensions, typography and motion

TokenLightDarkUse and unit
radius1212Corner radius. Number converted to px in --neu-radius.
spacing1616Base space used by consumers such as Card padding. Converted to px.
fontSize1616Font size in controls that use --neu-font-size. Converted to px.
duration120120Transition duration where consumed. Converted to ms; not a global animation switch.

These four properties are numbers. Pass radius: 16, not radius: "16px". Native layout resolves px according to the framework’s layout units; do not treat them as raw physical screen pixels.

The theme derives caption, label, row, heading and metric sizes and line heights from fontSize; components consume those variables where supported. It does not select a font family or replace every fixed size. Check system text scaling. The duration token does not disable every animation: reduced motion also depends on the component and framework.

Complete theme CSS reference

The following variables are generated on neu-theme. Use them in your native styles to share its palette and scale. To change the theme consistently, pass the corresponding NeuTokens properties through [tokens]; a local CSS override does not update the injected NEU_THEME value or components that compute their colors from it.

CSS variableLightDarkSource in the resolved theme
--neu-accent#006ee6#b5c4ffaccent
--neu-accent-ink#006bdf#b5c4ffaccentText, or the resolved semantic text color
--neu-danger-ink#ca2323#ffb4abdangerText, or the resolved semantic text color
--neu-success-ink#147a3a#8fdeb1successText, or the resolved semantic text color
--neu-info-ink#0064d1#7dd3fcinfoText, or the resolved semantic text color
--neu-on-accent#ffffff#172955onAccent
--neu-surface#ffffff#1b2230surface
--neu-canvas#f4f5f7#111722canvas
--neu-text#172033#edf1fatext
--neu-muted#596477#b4bed0muted
--neu-border#a5afbf#6c7a92border
--neu-surface-border#e1e6ed#354052surfaceBorder
--neu-divider#e7ebf0#303b4cdivider
--neu-surface-secondary#eef1f5#222d3fsurfaceSecondary
--neu-control-radius10px10pxradius × 5 / 6 px
--neu-surface-radius16px16pxradius × 4 / 3 px
--neu-overlay-radius16px16pxradius × 4 / 3 px
--neu-dialog-radius24px24pxradius × 2 px
--neu-caption-size13px13pxfontSize × 0.8125 px
--neu-label-size14px14pxfontSize × 0.875 px
--neu-row-size15px15pxfontSize × 0.9375 px
--neu-heading-size18px18pxfontSize × 1.125 px
--neu-metric-size32px32pxfontSize × 2 px
--neu-space-44px4pxspacing × 0.25 px
--neu-space-66px6pxspacing × 0.375 px
--neu-space-88px8pxspacing × 0.5 px
--neu-space-1010px10pxspacing × 0.625 px
--neu-space-1212px12pxspacing × 0.75 px
--neu-space-1616px16pxspacing × 1 px
--neu-space-2020px20pxspacing × 1.25 px
--neu-space-2424px24pxspacing × 1.5 px
--neu-tonal#eff6ff#293756tonal
--neu-danger#dc2626#ffb4abdanger
--neu-success#15803d#8fdeb1success
--neu-warning#f59e0b#efd48fwarning
--neu-info#0064d1#7dd3fcinfo
--neu-radius12px12pxradius px
--neu-spacing16px16pxspacing px
--neu-font-size16px16pxfontSize px
--neu-caption-line18px18pxfontSize × 1.125 px
--neu-label-line20px20pxfontSize × 1.25 px
--neu-row-line21px21pxfontSize × 1.3125 px
--neu-heading-line24px24pxfontSize × 1.5 px
--neu-metric-line38px38pxfontSize × 2.375 px
--neu-duration120ms120msduration ms

For numeric variables, the source column shows the multiplier and output unit. Radii, sizes, line heights and spaces use px; duration uses ms. Semantic text variables can be computed from the theme rather than copied directly from an accent color.

Keep custom tokens in one typed file

Create src/app/theme-tokens.ts and export the overrides used by the root theme. The satisfies operator checks property names and types while preserving TypeScript inference. This example keeps control text, decorative surfaces and the full-screen image canvas separate.

src/app/theme-tokens.ts
import type { NeuTokens } from '@neural-ui/native/foundation';

export const brandLight = {
  accent: '#3B5BDB',
  accentText: '#3048A5',
  onAccent: '#FFFFFF',
  tonal: '#EBEFFF',
  surfaceBorder: '#D8DEEB',
  divider: '#E8ECF3',
  surfaceSecondary: '#F0F3FA',
  mediaCanvas: '#101828',
  mediaText: '#F1F5F9',
  mediaBarStyle: 'light',
  radius: 16,
} satisfies Partial<NeuTokens>;

export const brandDark = {
  accent: '#B8C6FF',
  accentText: '#C6D0FF',
  onAccent: '#172955',
  tonal: '#293756',
  surfaceBorder: '#3B4863',
  divider: '#33405A',
  surfaceSecondary: '#263249',
  mediaCanvas: '#101828',
  mediaText: '#F1F5F9',
  mediaBarStyle: 'light',
  radius: 16,
} satisfies Partial<NeuTokens>;

The four optional semantic text colors are explicit overrides: when supplied, they are used as given. Check their contrast against your surfaces. The mediaBarStyle values are light and dark on both languages; they describe the foreground of system bars, not the application theme.

For a complete palette, spread the exported default instead of mutating it. The defaults are readonly frozen objects. The following src/app/complete-tokens.ts is an alternative to the partial objects above, useful when a service needs a full NeuTokens value.

src/app/complete-tokens.ts
import {
  NEU_LIGHT_TOKENS,
  NEU_DARK_TOKENS,
  type NeuTokens,
} from '@neural-ui/native/foundation';

export const completeLight: Readonly<NeuTokens> = {
  ...NEU_LIGHT_TOKENS,
  accent: '#3B5BDB',
  onAccent: '#FFFFFF',
};

export const completeDark: Readonly<NeuTokens> = {
  ...NEU_DARK_TOKENS,
  accent: '#B8C6FF',
  onAccent: '#172955',
};

Use tokens in your own native components

Create src/app/summary.component.ts and place app-summary inside the root neu-theme. The --neu-* variables let native styles share the palette. For properties computed in TypeScript or style bindings, inject NEU_THEME and read its signal. A computed value follows theme changes without caching an outdated snapshot.

src/app/summary.component.ts
import { Component, computed, inject } from '@angular/core';
import { Text, View } from '@ng-native/components';
import { NEU_THEME } from '@neural-ui/native/foundation';

@Component({
  selector: 'app-summary',
  imports: [Text, View],
  template: `
    <view class="panel" [style.borderColor]="borderColor()">
      <text class="title">Your workspace</text>
      <text class="description">Shared with your team</text>
    </view>
  `,
  styles: `
    .panel {
      padding: var(--neu-space-20);
      gap: var(--neu-space-8);
      background-color: var(--neu-surface);
      border-width: 1px;
      border-radius: var(--neu-surface-radius);
    }
    .title { color: var(--neu-text); font-size: var(--neu-heading-size); line-height: var(--neu-heading-line); font-weight: 600; }
    .description { color: var(--neu-muted); font-size: var(--neu-caption-size); line-height: var(--neu-caption-line); }
  `,
})
export class SummaryComponent {
  private readonly theme = inject(NEU_THEME);
  readonly borderColor = computed(() => this.theme().surfaceBorder ?? this.theme().border);
}

This example requires a theme ancestor because it injects NEU_THEME directly. Keep native token styles inside the native application or playground. The documentation shell uses Neural UI v2 and has its own web theme; do not apply its web styles to the Native preview.