Component gallery

Interaction hooks

The small framework-free hooks the apps lean on: keyboard shortcuts, debounced input, hydration-safe persistence, and link interception.

useKeyPress

Key name, array, or a predicate for modifier combos: callback held in a ref
Press / anywhere: 0
Predicate combo Ctrl+Shift+K: off

useDebounce

Follows a value but only settles after it stops changing
Debounced (300ms): -

useLocalStorage

Reload-safe state; the key-name union is the consumer's to own
Component A
Component B
Both fields are separate components bound to playground.note: typing in one updates the other (same tab via a sync event, other tabs via the native storage event), and either clear resets both. Reload the page: the value is read synchronously, no default-value flash.

useSessionStorage

The per-tab sibling: same API over sessionStorage
Same contract as useLocalStorage, scoped to this tab: reload keeps it, a new tab starts clean.

useDisabledReason

Priority-ordered checks → { disabled, reason }; spread buttonProps to get a bricked Button that explains itself on hover
blocked: No template selected

useNavHijack

Match a URL pattern and run a callback instead of navigating
@versable-git/ui · all states, both themes