Haptic Feedback
Trigger haptic feedback on mobile devices.
Loading…
Features
- Uses Vibration API on Android and iOS checkbox trick on iOS.
- Supports custom duration and vibration patterns on Android devices.
- The haptic functionality was inspired by the Vercel mobile experience.
Installation
$ pnpm dlx shadcn@latest add @ncdai/haptic
Usage
import { haptic } from "@/lib/haptic"<Button onClick={() => haptic()}>Haptic</Button>Haptic feedback should not be used arbitrarily. For best practices, please refer to Apple's Human Interface Guidelines on Playing haptics.
API Reference
Prop
Type
