Configuration
Configure NeuralNg once, then control direction, density and color mode through small Signal-based runtime services.
APPLICATION SETUP
Register the environment providers
provideNeuralNg() owns shared component preferences and the initial locale. provideNeuralAppearance() is the optional application controller for palettes, mode, direction, persistence and the root DOM contract.
Defaults and accepted values
Every option is optional. Unknown palettes and invalid direction, density or color-mode values fail immediately instead of silently producing mixed state.
unstyledfalsetrue | falsedirectionautoauto | ltr | rtldensitycomfortablecompact |
comfortable | spaciouslocaleEnglishNeuralLocaleprimaryblueregistered palette namesurfaceslateregistered palette namemodesystemlight | dark |
systemstorageKeyneural-appearancestring prefix | nullLive configuration
These controls update the same root-level contracts used by every component on this documentation site.
Direction
Density
- Configured direction
- ltr
- Resolved direction
- ltr
- Density
- comfortable
Runtime direction and density
direction(), resolvedDirection() and density() are readonly Signals. When direction is auto, the active locale supplies the resolved direction. reset() restores the provider values.
One reactive appearance controller
primary(), surface(), mode(), resolvedMode() and direction are readonly Signals. Commands update the complete palette, namespaced DOM attributes and persisted preferences together.
storageKey: null when persistence is not wanted. Appearance already configures color mode; do not also register provideNeuralColorMode(). The root DOM contract
NeuralNg uses namespaced data attributes and the native dir attribute. Theme identity and resolved color mode are deliberately separate concerns. Primary and surface names identify the active registered scales.
Global headless mode
Global unstyled removes NeuralNg visual classes from all participating components. Native semantics, interaction, ARIA, structural hooks and typed consumer class slots remain.
SSR and hydration rules
Use the same initial locale
Configure identical locale and direction inputs on server and browser. Do not infer locale during component rendering.
Plan first-paint mode
The server cannot read local storage or media queries. Use an application-owned CSP-compatible head script when persisted mode must apply before paint.