Skip to content
Docs
훅으로 돌아가기

useDotMap

@hua-labs/ui

설치

bash
npm install @hua-labs/hua
Import
tsx
import { useDotMap } from "@hua-labs/hua/framework";

@hua-labs/motion-core의 모션 훅을 @hua-labs/hua/framework에서 통합 제공합니다.

UI 컴포넌트, 모션 훅, i18n을 하나의 패키지로 사용할 수 있습니다.

기본 사용법

tsx
import { useDotMap } from '@hua-labs/ui';

const { style, handlers } = useDotMap('p.4 bg.blue-500 hover:bg.blue-600', {
  disabled: false,
});

return <div style={style} {...handlers}>Interactive element</div>;

API 레퍼런스

옵션

이름타입기본값설명
dotStringstring-docs:hooks.use-dot-map.options.dotString
state{ disabled?: boolean; active?: boolean }-docs:hooks.use-dot-map.options.state

반환값

이름타입설명
styleReact.CSSPropertiesdocs:hooks.use-dot-map.returns.style
handlers{ onMouseEnter, onMouseLeave, onFocus, onBlur }docs:hooks.use-dot-map.returns.handlers

사용 사례