Haptics

Add native impact, selection, notification, and custom haptic feedback.

Inject IHaptics into the ViewModel or service that owns the interaction:

public sealed class EditorViewModel(IHaptics haptics)
{
    public void Saved()
    {
        haptics.Impact(HapticStyle.Light);
        haptics.Selection();
        haptics.Notify(HapticsNotification.Success);
    }
}

Impact communicates contact or weight and supports light, medium, heavy, soft, and rigid styles. Selection is the subtle response for moving between discrete choices. Notify represents a completed success, warning, or error.

Custom patterns

Build a short Core Haptics pattern from taps and continuous events:

haptics.Play(
    HapticEvent.Tap(time: 0, intensity: 0.8, sharpness: 0.9),
    HapticEvent.Tap(time: 0.12, intensity: 1, sharpness: 0.7),
    HapticEvent.Continuous(time: 0.2, duration: 0.25, intensity: 0.45, sharpness: 0.3));

Time and duration are expressed in seconds. Intensity and sharpness are clamped between zero and one. Unsupported hardware is handled as a no-op.

IHaptics is registered with the other built-in services described in application setup and DI. Custom views can use the same service directly through their protected Haptics property.

Haptics should reinforce a visible or audible result, not carry meaning alone. Avoid firing feedback for every routine tap; system controls already provide their expected interaction behavior.

For the command and gesture boundaries that usually trigger feedback, see commands and gestures.