Haptics are a way to add tactile feedback to your app to enhance user interaction and responsiveness. This guide walks you through implementing haptics in a Farcaster Mini App for a more intuitive and engaging user experience.Documentation Index
Fetch the complete documentation index at: https://docs.monad.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Implementing haptics in a Farcaster Mini App
If you are using the Monad Mini App template, you can usehaptics from the useFrame hook.
If you are not using the Monad Mini App template, you can inspect the useFrame hook to check out the implementation details.
Below is an example of how to implement haptics in a Farcaster Mini App:
Supported haptics
The following haptics are supported:| Haptic Type | Code |
|---|---|
| Light Impact | haptics.impactOccurred('light') |
| Medium Impact | haptics.impactOccurred('medium') |
| Heavy Impact | haptics.impactOccurred('heavy') |
| Soft Impact | haptics.impactOccurred('soft') |
| Rigid Impact | haptics.impactOccurred('rigid') |
| Success Notification | haptics.notificationOccurred('success') |
| Warning Notification | haptics.notificationOccurred('warning') |
| Error Notification | haptics.notificationOccurred('error') |
| Selection Change | haptics.selectionChanged() |

