Skip to main content

Hooks

Headless interaction primitives and reactive utilities exported from moraine/utils.

View as Markdown

Moraine exports its headless interaction primitives and reactive utilities from the moraine/utils entry point. These hooks back Moraine’s own components. Use them to build custom controls.

Import#

Import hooks from the moraine/utils subpath:

import {
  createBaseSelectSearchInput,
  createControllableValue,
  createCopy,
  createDisclosureState,
  createEventListener,
  createEventListenerMap,
  createId,
  createMediaQuery,
  createSelectableCollectionNavigation,
  createSlider,
  createTransitionPresence,
} from 'moraine/utils'

The styling helpers cn, createCn, and useCn are exported from moraine, not moraine/utils. See Class Merging.

Headless Hooks#