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
npm yamada-cli add use-disclosure
yarn yamada-cli add use-disclosure
bun yamada-cli add use-disclosure
Yamada UI updates the hooks, you can easily update them in the same way as Update Components. If your changes conflict with the updates, they will be displayed in the same way as the HOW CONFLICTS ARE PRESENTED of Git, and you can easily resolve them.
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"
import { useDisclosure } from "@/components/ui"
import { useDisclosure } from "@workspaces/ui"
Hooks
Here's a list of all the hooks available in the library.
useAnimationuseAsyncuseAsyncCallbackuseBooleanuseBreakpointuseBreakpointEffectuseBreakpointStateuseBreakpointValueuseClipboarduseColorModeuseColorModeValueuseCounteruseDescendantsuseDisclosureuseDynamicAnimationuseEyeDropperuseFocusOnShowuseFormatByteuseFormatDateTimeuseFormatNumberuseHoveruseIdleuseInfiniteScrolluseIntervaluseLoadinguseLocalStorageuseMediaQueryuseNoticeuseOSuseOutsideClickusePrevioususeProcessingusePromiseDisclosureuseResizeObserveruseThemeuseTimeoutuseUpdateEffectuseUpdateBreakpointEffectuseValueuseWindowEvent