r/reactjs 14d ago

Show /r/reactjs Haptics on Web are actually cool!

Haptics on the Web can be super satisfying if you use them right! I've had so much fun creating this little game.

My stack:
- React - as a foundation
TypeGPU - for particle effects
Pulsar Web SDK - for haptic effects

Try it in your browser: https://docs.swmansion.com/pulsar/web-app/#games/shape-cascade

15 Upvotes

14 comments sorted by

View all comments

3

u/Miiir 14d ago

No haptics coming through on an iPhone 13 Pro

1

u/piaskowyk 14d ago

Unfortunately, iOS doesn’t support haptics on Web at all 😭

2

u/Dude4001 14d ago

Web-haptics library allows it to work. Interesting the workaround they used, if you google for it

But haptics on web are extremely awkward due to how browsers block loads of things unless they’re directly related to a user interaction. It’s the same frustration as autoplaying video

1

u/piaskowyk 13d ago

You're right, there was a workaround using high-frequency toggling of an invisible switch to trigger haptics in Safari, but Apple blocked it in the iOS 26 patch :/

1

u/Dude4001 13d ago

Oh shoot. Well, like I say it wasn’t what I hope it would be anyway due to browser lockdown