Foundations
Design tokens
A typed reference for the palette, dimensions and motion values used by the library.
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.
| Token | Light | Dark | Purpose |
|---|---|---|---|
| accent | #006ee6 | #b5c4ff | Primary actions and selected states. |
| onAccent | #ffffff | #172955 | Text and icons on an accent background. |
| surface | #ffffff | #1b2230 | Cards and control backgrounds. |
| canvas | #f4f5f7 | #111722 | The background of the theme container. |
| text | #172033 | #edf1fa | Primary text and labels. |
| muted | #596477 | #b4bed0 | Secondary text, hints and placeholders. |
| border | #a5afbf | #6c7a92 | Functional outlines for inputs and other controls. |
| tonal | #eff6ff | #293756 | Soft background for tonal actions. |
| danger | #dc2626 | #ffb4ab | Errors and destructive feedback. |
| success | #15803d | #8fdeb1 | Positive status and confirmation. |
| warning | #f59e0b | #efd48f | Warnings that need attention. |
| warningText | #92400e | #efd48f | Readable warning text on transparent or tonal buttons. |
| onWarning | #111827 | #111722 | Text and loading indicators on a solid warning button. |
| info | #0064d1 | #7dd3fc | Informational 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.
| Property | Light | Dark | Purpose |
|---|---|---|---|
| accentText | Automatic | Automatic | Readable brand text; automatically resolved when omitted. |
| dangerText | Automatic | Automatic | Readable destructive text; automatically resolved when omitted. |
| successText | Automatic | Automatic | Readable success text; automatically resolved when omitted. |
| infoText | Automatic | Automatic | Readable informational text; automatically resolved when omitted. |
| surfaceBorder | #e1e6ed | #354052 | Decorative surface outlines, independent of control borders. |
| divider | #e7ebf0 | #303b4c | Separators between related content. |
| surfaceSecondary | #eef1f5 | #222d3f | Secondary surfaces within a layout. |
| mediaCanvas | #111722 | #111722 | Full-screen image canvas, independent of the application color scheme. |
| mediaText | #edf1fa | #edf1fa | Readable image-viewer controls over the media canvas. |
| mediaBarStyle | light | light | System-bar foreground for the image viewer: light or dark. |
Dimensions, typography and motion
| Token | Light | Dark | Use and unit |
|---|---|---|---|
| radius | 12 | 12 | Corner radius. Number converted to px in --neu-radius. |
| spacing | 16 | 16 | Base space used by consumers such as Card padding. Converted to px. |
| fontSize | 16 | 16 | Font size in controls that use --neu-font-size. Converted to px. |
| duration | 120 | 120 | Transition 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 variable | Light | Dark | Source in the resolved theme |
|---|---|---|---|
| --neu-accent | #006ee6 | #b5c4ff | accent |
| --neu-accent-ink | #006bdf | #b5c4ff | accentText, or the resolved semantic text color |
| --neu-danger-ink | #ca2323 | #ffb4ab | dangerText, or the resolved semantic text color |
| --neu-success-ink | #147a3a | #8fdeb1 | successText, or the resolved semantic text color |
| --neu-info-ink | #0064d1 | #7dd3fc | infoText, or the resolved semantic text color |
| --neu-on-accent | #ffffff | #172955 | onAccent |
| --neu-surface | #ffffff | #1b2230 | surface |
| --neu-canvas | #f4f5f7 | #111722 | canvas |
| --neu-text | #172033 | #edf1fa | text |
| --neu-muted | #596477 | #b4bed0 | muted |
| --neu-border | #a5afbf | #6c7a92 | border |
| --neu-surface-border | #e1e6ed | #354052 | surfaceBorder |
| --neu-divider | #e7ebf0 | #303b4c | divider |
| --neu-surface-secondary | #eef1f5 | #222d3f | surfaceSecondary |
| --neu-control-radius | 10px | 10px | radius × 5 / 6 px |
| --neu-surface-radius | 16px | 16px | radius × 4 / 3 px |
| --neu-overlay-radius | 16px | 16px | radius × 4 / 3 px |
| --neu-dialog-radius | 24px | 24px | radius × 2 px |
| --neu-caption-size | 13px | 13px | fontSize × 0.8125 px |
| --neu-label-size | 14px | 14px | fontSize × 0.875 px |
| --neu-row-size | 15px | 15px | fontSize × 0.9375 px |
| --neu-heading-size | 18px | 18px | fontSize × 1.125 px |
| --neu-metric-size | 32px | 32px | fontSize × 2 px |
| --neu-space-4 | 4px | 4px | spacing × 0.25 px |
| --neu-space-6 | 6px | 6px | spacing × 0.375 px |
| --neu-space-8 | 8px | 8px | spacing × 0.5 px |
| --neu-space-10 | 10px | 10px | spacing × 0.625 px |
| --neu-space-12 | 12px | 12px | spacing × 0.75 px |
| --neu-space-16 | 16px | 16px | spacing × 1 px |
| --neu-space-20 | 20px | 20px | spacing × 1.25 px |
| --neu-space-24 | 24px | 24px | spacing × 1.5 px |
| --neu-tonal | #eff6ff | #293756 | tonal |
| --neu-danger | #dc2626 | #ffb4ab | danger |
| --neu-success | #15803d | #8fdeb1 | success |
| --neu-warning | #f59e0b | #efd48f | warning |
| --neu-info | #0064d1 | #7dd3fc | info |
| --neu-radius | 12px | 12px | radius px |
| --neu-spacing | 16px | 16px | spacing px |
| --neu-font-size | 16px | 16px | fontSize px |
| --neu-caption-line | 18px | 18px | fontSize × 1.125 px |
| --neu-label-line | 20px | 20px | fontSize × 1.25 px |
| --neu-row-line | 21px | 21px | fontSize × 1.3125 px |
| --neu-heading-line | 24px | 24px | fontSize × 1.5 px |
| --neu-metric-line | 38px | 38px | fontSize × 2.375 px |
| --neu-duration | 120ms | 120ms | duration 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.
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.
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.
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.