On this page

HeroUI Native publishes nine design principles. The kit keeps their spirit and changes what a native renderer and an agent registry change. Each rule below names what it means in code, so you can check a family against it.

Semantic intent over looks

Names say what something is for, not how it looks. Colors are accent, surface, overlay, field, focus and danger, never orange or gray200; each fill has a Foreground made to sit on it. Variants name intent too: a button is primary, secondary, tertiary, outline, ghost, danger, danger-soft, glass or glass-prominent. Change the brand and every variant still means the same thing.

Accessibility as the foundation

Accessibility is part of the component, not a pass at the end. Interactive families require an accessible name: usually a required label prop, or item and presentation titles where the family is structured around them (such as Tabs items and Sheet’s title), which is also the name agents see. OS widgets (switches, sliders, pickers, editors) keep their native accessibility; custom controls wrap their touch target in the Semantics host with a role, value, state and activation. Every touch target keeps at least 44 points, and outcomes are announced with announce().

Composition over configuration

A family is a compound object of named parts: Button.Root, Button.Leading, Button.Label, Button.Trailing. Rearrange, wrap or replace parts instead of looking for a prop that does it. Custom children opt into a part’s styles with a typed part prop and the family’s use<Name>Part hook.

Progressive disclosure

The simplest use is one line: <Switch.Root label="Wi-Fi" /> renders its label beside a native switch. Add value to control it, api to drive it, styles to restyle a part, children to change the anatomy. You only meet the next layer when you need it.

Predictable behavior

Every action returns a status: accepted, disabled, refused or unavailable, plus requested when a controlled value waits for its owner. A disabled control refuses every source. details.preventDefault() declines a change from any source. Drags and range interactions report one onValueCommit per interaction. The same input always produces the same result, whoever sent it.

Type safety

Parts, variants, sizes, style resolvers and action arguments are typed. An unknown part, a wrong variant or a bad argument fails the type check; each family has type tests with @ts-expect-error for exactly these mistakes. Agent actions validate their arguments again at runtime, because agents do not run the type checker.

Native-first performance

The OS draws and animates. Switches, sliders, pickers, editors, menus, dialogs and sheets are registered native views; pressed and open states animate with View.animate and springs, with no JavaScript render loop (continuous native controls such as Slider still send value changes to JavaScript while dragging and commit once when the gesture ends). Callbacks are stable, context values and instances memoized, and families built on usePartStyles cache resolved styles per context so a parent render does not re-bind native handlers.

Agent-ready

Every interactive family registers with the agent registry when it is mounted under an AgentProvider. Agents read a snapshot, query by role, name or text, and act through the same actions as touch, with details.source set to "agent". Secrets are redacted, refs go stale with their control, and actions marked with confirm (such as delete, pay or send) wait for a confirmation only a person can give.

Complete customization through styles

Every part can be restyled with the typed styles map. A resolver receives the tokens, the variant, the size and the state, so a custom style still follows dark mode, disabled and pressed states. Change tokens globally with createTokens; change one part of one instance with styles. OS-drawn parts expose the styling their native hosts support.