UIInternal UI

Hooks

7 behavior hooks — tokens, viewport, press, toasts, scroll chaining, and focus.

useCssTokens

@randall-enterprises/ui/hooks/use-css-tokens

Reads 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-mobile

Breakpoint hook. Undefined on first paint, then tracks matchMedia.

Viewport is desktop — resize to watch it flip.

usePressOrigin

@randall-enterprises/ui/hooks/use-press-origin

Writes the press point for the cursor-origin glow on buttons and fields.

useVerticalWheelChain

@randall-enterprises/ui/hooks/use-vertical-wheel-chain

Chains 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-chain

The pure helpers behind the hook: scrollability tests and the scroller class.

Props (5)

wrapper *T
start *T | null
parentOf *(node: T) => T | null
canScroll *(node: T, deltaY: number) => boolean
deltaY *number

returns T | null

HORIZONTAL_SCROLL_CLASS = "overflow-x-auto overflow-y-clip"

useRestoreFocusOnClose

@randall-enterprises/ui/lib/use-restore-focus-on-close

Returns focus to the opener when an overlay closes. Pass a mount signal.

Props (1)

mountSignal *unknown