Haptic feedback, those subtle vibrations you feel when tapping buttons on your phone, makes your app feel responsive and professional. This guide shows you how to add haptics to your Replit app using simple prompts. No coding required.
What you’ll learn:
- What haptic feedback is and why it matters
- How to add haptics using the Replit Agent
- How to test on real devices
Before you start:
Haven’t installed the JavaScript Bridge yet? Follow our Getting started with Replit guide first. The bridge connects your web app to native phone features like haptics.
What is haptic feedback?
It’s the gentle vibration you feel when you interact with your phone. You typically experience haptics when:
- Typing on your keyboard
- Pulling down to refresh
- Confirming an action
- Getting an error
Why add it to your app?
- It confirms that actions worked.
- It helps users who rely on touch feedback.
- Different patterns communicate different things, like success, warnings, or errors.
When you convert your Replit app to mobile using Median, the JavaScript Bridge gives you access to the phone’s vibration motor. Here’s the flow:
- Your Replit app is the web application you built.
- Median converts your app into a full-feature native app.
- The JavaScript Bridge lets your app trigger vibrations.
- You tell Replit Agent where you want haptics, and it handles the code.
Step 1: Choose your haptic type
Median offers several types. Each one feels different and communicates something specific.
Impact haptics (for interactions)
Use these when someone taps, swipes, or interacts with something:
Notification haptics (for outcomes)
Use these to communicate results:
Special haptics
For specific interactions:
Quick decision guide
- Button press? Use
impactLight.
- Success? Use
notificationSuccess.
- Error? Use
notificationError.
- Deleting something? Use
impactMedium or impactHeavy.
Step 2: Add haptics with a prompt
Here are ready-to-use prompts for common scenarios.
Example: Haptics for task creation
Let’s say you want haptic feedback when users create a task. Prompt Replit Agent with this:
What happens next:
Replit Agent implements three things:
- Detection: Checks if the user is in the mobile app (not the web version)
- Haptic integration: Adds the trigger code
- Proper timing: Fires the haptic when the task is created
What’s happening under the hood:
- It checks if you’re in the mobile app (
isNativeApp).
- It waits for the bridge to load (
isReady).
- It triggers haptics and handles errors so nothing breaks.
Step 3: More examples you can use
Here are more prompts for common use cases. Just customize them to your project and paste them into Replit Agent.
Add haptics to a button
Customize: replace [BUTTON_NAME] with your button (like “Submit” or “Save”). Change impactLight to impactMedium or impactHeavy for important buttons.
Add haptics to form submission
Customize: replace [FORM_NAME] with your form name (like “login form” or “checkout form”).
Add haptics to swipe actions
Customize: replace [LIST_NAME] with your list (like “task list” or “inbox”). Consider impactHeavy for destructive actions, such as deleting a task, email, or an item from a list.
Add haptics to toggle switches
Step 4: Test on a real device
Note: Haptics only work on physical devices, not in simulators or web browsers.
Testing process:
- Prompt Replit Agent to add haptics (using the examples above).
- Deploy your changes in Replit, so your live URL is updated.
- Customize your mobile app in App Studio.
- Install the app on your phone (iOS or Android).
- Test the features you enhanced: make sure your phone’s vibration is on, feel the difference between haptic types, verify haptics only trigger in the mobile app.
Not working? Check these:
- Are haptics enabled in the App Studio plugin settings?
- Is your phone’s vibration turned on?
- Was the JavaScript Bridge installed correctly?
- Any errors in the console?
- Is the detection code (
isNativeApp) working?
Last modified on November 7, 2026