useVibration
HookWraps the Vibration API for haptic feedback on mobile devices. Accepts a single duration or a pattern array. Falls back silently on desktop.
core/use-vibrationInstallation
1 · Add registry to components.json
2 · Install component
Examples
Haptic feedback
Triggers device vibration on supported mobile browsers.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
isSupported | boolean | — | Whether the Vibration API is available. |
vibrate | (pattern: number | number[]) => void | — | Trigger vibration with a duration (ms) or pattern. |
stop | () => void | — | Stop any active vibration. |