Hooks
7 behavior hooks — tokens, viewport, press, toasts, scroll chaining, and focus.
useCssTokens
@randall-enterprises/ui/hooks/use-css-tokensReads live CSS custom-property values with a theme-change subscription. Backs the Foundations page.
Props (2)
names *readonly string[]elementRefObject<HTMLElement | null>returns Record<string, string>
useMobile
@randall-enterprises/ui/hooks/use-mobileBreakpoint hook. Undefined on first paint, then tracks matchMedia.
Viewport is desktop — resize to watch it flip.
usePressOrigin
@randall-enterprises/ui/hooks/use-press-originWrites the press point for the cursor-origin glow on buttons and fields.
useVerticalWheelChain
@randall-enterprises/ui/hooks/use-vertical-wheel-chainChains vertical wheel past horizontal scrollers to the page. Scroll vertically over the row below.
card-1card-2card-3card-4card-5card-6card-7card-8card-9card-10card-11card-12
verticalWheelChain
@randall-enterprises/ui/hooks/vertical-wheel-chainThe pure helpers behind the hook: scrollability tests and the scroller class.
Props (5)
wrapper *Tstart *T | nullparentOf *(node: T) => T | nullcanScroll *(node: T, deltaY: number) => booleandeltaY *numberreturns T | null
HORIZONTAL_SCROLL_CLASS = "overflow-x-auto overflow-y-clip"
useRestoreFocusOnClose
@randall-enterprises/ui/lib/use-restore-focus-on-closeReturns focus to the opener when an overlay closes. Pass a mount signal.
Props (1)
mountSignal *unknown