Haptic feedback is the short vibration that confirms a tap, a success or an error. It's a small detail, but it's one of the things that make an app feel native rather than like a website. What the person feels depends on their phone and its settings.
Platforms
Included- Android
- iOS
Used by the native builds: Android Build (Native), Android TV and iOS. The Android Build (Web) does not read these settings.
When to use it
- A light tap on the main buttons
- A success feedback when a form is sent
- An error feedback when something fails
- A soft tick when moving through a picker
Keep it for moments that matter. A vibration on every tap quickly gets annoying.
Set it up
Add the plugin
In your project's plugin library, add Haptic feedback, then launch a new build.
Call it from your site
Call each method optionally: it doesn't exist in a normal browser.
JavaScript API
const haptics = window.saastostore?.haptics;
await haptics?.impact({ style: "medium" }); // light | medium | heavy
await haptics?.notification({ type: "success" }); // success | warning | error
await haptics?.selection(); // a light tick
await haptics?.vibrate({ duration: 200 }); // ms, 1 to 1000
// → { ok: true }
// → { ok: false, error: "invalid_argument" } e.g. duration: 5000
// → { ok: false, error: "not_available" } Android: the device plays nothing| Method | Argument | Default |
|---|---|---|
impact | style: light, medium, heavy | medium |
notification | type: success, warning, error | success |
selection | None | None |
vibrate | duration: 1 to 1000 ms | 300 |
iOS can't set a duration, so vibrate plays a strong impact. On Android, calls answer not_available when the device plays nothing, as on most tablets and TVs. iOS answers ok: true in that case.
Prompt for AI builders
Prompt for Lovable, Bolt or Base44
My website also runs inside a mobile app. Inside the app, window.saastostore?.haptics gives access to haptic feedback. In a normal browser it doesn't exist, and nothing must change.
Call it optionally: window.saastostore?.haptics?.impact(...). Its promise never rejects.
Call haptics.impact({ style: "light" }) when a main button is tapped, and haptics.notification({ type: "success" }) or ({ type: "error" }) after a form succeeds or fails.Then test on a real phone. Emulators don't vibrate.