Hooks
Reference

Hooks

The hooks used by Onset components, importable for building custom components.

Onset components use these hooks internally. They are exported so custom components can use the same behavior.

State

Controlled and uncontrolled prop pairs.

Overlay behavior

Dismissal, focus, and scroll locking for overlays.

SSR

Rendering the same markup on server and first client paint.

Refs & navigation

Ref merging and roving keyboard navigation.

Pointer & layout

Reading pointer gestures, element sizes, and motion preferences.

Forms

Reading the state a form group or field publishes.

Tiling

Editing a tile layout and reading the enclosing tile cell.

Flows

Multi-step flow state without built-in UI.

Virtualisation

Computing which rows to render for a given scroll offset.

Theming & portals

Reading and changing the resolved theme.

Toast & command palette

Imperative APIs owned by a provider.