Notification Presets
Based onUINotificationFeedbackGenerator from iOS.
success
Ascending double-tap indicating success.Light tap followed by a stronger tap, creating an upward momentum that feels positive and confirming.
warning
Two taps with hesitation indicating a warning.Strong tap, longer pause, then a softer tap. The hesitation creates uncertainty, signaling caution.
error
Three rapid harsh taps indicating an error.Three sharp, rapid taps with short gaps. The intensity and repetition convey urgency and alert the user to a problem.
Impact Presets
Based onUIImpactFeedbackGenerator from iOS.
light
Single light tap indicating a minor impact.Brief, gentle tap. Perfect for subtle interactions like hovering or minor state changes.
Hover effects, checkbox toggles, subtle UI feedback
medium
Moderate tap for standard interactions.Balanced tap with moderate strength. The default preset for most interactions.
Button clicks, navigation, standard UI interactions
heavy
Strong tap for significant interactions.Strong, pronounced tap with full intensity. Conveys importance and weight.
Confirmations, deletions, important actions, drag-and-drop
soft
Soft, cushioned tap with a rounded feel.Longer duration but moderate intensity, creating a soft, cushioned sensation.
Gentle notifications, soft transitions, relaxed interactions
rigid
Hard, crisp tap with a precise feel.Very short but full intensity, creating a sharp, precise sensation.
Precise selections, snapping to positions, mechanical interactions
Selection Preset
Based onUISelectionFeedbackGenerator from iOS.
selection
Subtle tap for selection changes.Very brief, gentle tap. Almost imperceptible but provides subtle feedback.
Picker scrolling, carousel navigation, selection changes in lists
Custom Presets
Additional patterns for common use cases.nudge
Two quick taps with a pause, indicating a nudge or reminder.Strong initial tap followed by a gentler tap after a pause. Like a gentle poke to get attention.
Notifications, reminders, getting user attention
buzz
Rapid, low-intensity taps creating a buzzing effect.Continuous vibration for 1 second at full intensity. Creates a sustained buzzing sensation.
Alarms, alerts, timers, urgent notifications
Preset Comparison Table
| Preset | Duration | Intensity | Feel | Best For |
|---|---|---|---|---|
light | 15ms | 0.4 | Gentle tap | Subtle interactions |
selection | 8ms | 0.3 | Very subtle | Picker scrolling |
medium | 25ms | 0.7 | Balanced | Standard clicks |
soft | 40ms | 0.5 | Cushioned | Gentle notifications |
rigid | 10ms | 1.0 | Crisp | Precise selections |
heavy | 35ms | 1.0 | Strong | Important actions |
success | Multi-tap | 0.5→1.0 | Ascending | Success feedback |
warning | Multi-tap | 0.8→0.6 | Hesitant | Caution alerts |
error | Multi-tap | 0.9×3 | Harsh | Error alerts |
nudge | Multi-tap | 0.8→0.3 | Poking | Reminders |
buzz | 1000ms | 1.0 | Continuous | Alarms |
Using Presets
Presets can be triggered by name:Creating Custom Presets
You can create your own presets using theHapticPreset type:
Preset Implementation
All presets are defined in the source code atsrc/lib/web-haptics/patterns.ts: