Skip to content
Docs
훅으로 돌아가기

useCustomCursor

@hua-labs/hua/motion

설치

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

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

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

기본 사용법

tsx
const cursor = useCustomCursor();

return (
  <>
    <div style={cursor.style} className="custom-cursor" />
    <button data-cursor="Click me">Hover me</button>
  </>
);

API 레퍼런스

옵션

이름타입기본값설명
enabledbooleantruedocs:hooks.use-custom-cursor.options.enabled
sizenumber32docs:hooks.use-custom-cursor.options.size
smoothingnumber0.15docs:hooks.use-custom-cursor.options.smoothing
hoverScalenumber1.5docs:hooks.use-custom-cursor.options.hoverScale
detectLabelsbooleantruedocs:hooks.use-custom-cursor.options.detectLabels

반환값

이름타입설명
xnumberdocs:hooks.use-custom-cursor.returns.x
ynumberdocs:hooks.use-custom-cursor.returns.y
labelstring | nulldocs:hooks.use-custom-cursor.returns.label
isHoveringbooleandocs:hooks.use-custom-cursor.returns.isHovering
styleCSSPropertiesdocs:hooks.use-custom-cursor.returns.style
isVisiblebooleandocs:hooks.use-custom-cursor.returns.isVisible

사용 사례

인터랙티브 UI

제스처 기반 인터랙티브 컴포넌트