Skip to content

Themes and custom components

Alicorn’s theme system is a small typed design-token compiler, not a stylesheet cascade. Themes bind semantic color roles and control recipes to values. Applications and component packages can add namespaced extension roles without changing Alicorn’s core role enum.

A theme can change how a selected, hovered, pressed, or disabled control looks. The control’s semantic role, label, value, actions, and state remain owned by the UI description.

For a quick start, see the typed theme guide and the theme compiler under theme/.

An application can build a compound control from existing public primitives: ordinary layout scopes, semantic surfaces, visual parts, extension roles, and retained motion. The component owns its recipe and per-instance design choices; Alicorn continues to own retained identity, hit testing, focus, and the native input lifecycle.

The repository’s custom-control examples and tests are the best guide to the current API. Start at examples and read the API reference before depending on a lower-level contract.

Extension roles are namespaced and typed. A component that depends on one should document the role name and provide a deliberate fallback or clear configuration diagnostic. Do not assume a valid role ID proves that the active theme has bound it.

For reusable application components that build on Alicorn rather than changing its runtime, see the companion AliKit component catalog.