Hooks

Convenient custom hooks are provided in Yamada UI to help you build your projects more quickly.

Usage

Yamada UI provides hooks in two ways. One is a new method of downloading hooks locally from CLI. The other is the traditional method of importing hooks from modules.

Download

The cases for downloading hooks locally from CLI are as follows.

  • Customize the initial value or logic of the hook.
  • Fix a bug in the hook's logic by directly modifying it.
pnpm yamada-cli add use-disclosure

Import

If you want to use the hook without making any changes, you can simply import the hook from the module.

import { useDisclosure } from "@yamada-ui/react"

Hooks

Here's a list of all the hooks available in the library.

useAnimationuseAsyncuseAsyncCallbackuseBooleanuseBreakpointuseBreakpointEffectuseBreakpointStateuseBreakpointValueuseClipboarduseColorModeuseColorModeValueuseCounteruseDescendantsuseDisclosureuseDynamicAnimationuseEyeDropperuseFocusOnShowuseFormatByteuseFormatDateTimeuseFormatNumberuseHoveruseIdleuseInfiniteScrolluseIntervaluseLoadinguseLocalStorageuseMediaQueryuseNoticeuseOSuseOutsideClickusePrevioususeProcessingusePromiseDisclosureuseResizeObserveruseThemeuseTimeoutuseUpdateEffectuseUpdateBreakpointEffectuseValueuseWindowEvent