← All demos

Web Haptics API

Test bed for the proposed Web Haptics API — a semantic, cross-platform interface for tactile feedback through navigator.playHaptics(effect, intensity).

Checking for API support…

Imperative API (JavaScript)

navigator.playHaptics()

Each button calls navigator.playHaptics(effect, intensity) with one of the six predefined effects. Requires sticky user activation — a click satisfies that. If the last input device isn't haptics-capable, nothing plays (and, by design, the API returns undefined either way).

1.00
// Activity log
navigator.playHaptics("align", 0.8);

Imperative patterns

Real-world use cases

Each example calls the same play(effect, intensity) helper on a meaningful UI transition rather than on every movement.

Interactive field

Focusing the field gives a subtle cue that it is ready.

File between folders

Drag the file. Entering a different folder triggers one Hint.

📁 Design
📁 Planning
📁 Archive
Not filed.