SuperAPI AI Directory

tauri-app-haptics

Coding & development

View repository

Updated 10-16 07:53

About this skill

When to use this skill

ALWAYS use this skill when the user mentions:

  • Tactile or haptic feedback on mobile devices
  • Vibration patterns or feedback types
  • Fallback for devices without haptic support

Trigger phrases include:

  • "haptics", "vibration", "tactile feedback", "haptic feedback", "vibrate"

How to use this skill

  1. Install the haptics plugin:
    cargo add tauri-plugin-haptics
    
  2. Register the plugin in your Tauri builder:
    tauri::Builder::default()
        .plugin(tauri_plugin_haptics::init())
    
  3. Configure capabilities in src-tauri/capabilities/default.json:
    { "permissions": ["haptics:allow-vibrate", "haptics:allow-impact-feedback", "haptics:allow-notification-feedback"] }
    
  4. Trigger haptic feedback from the frontend:
    import { impactFeedback, notificationFeedback, ImpactFeedbackStyle } from '@tauri-apps/plugin-haptics';
    await impactFeedback(ImpactFeedbackStyle.Medium);
    await notificationFeedback('success');
    
  5. Use appropriate feedback types: impact for touch interactions, notification for success/error/warning
  6. Handle unsupported devices with try/catch and silent fallback (no error shown to user)

Outputs

  • Haptic feedback integration with appropriate feedback types
  • Pattern selection guidance (impact vs notification)
  • Silent fallback for unsupported devices

References

Keywords

tauri haptics, vibration, tactile feedback, mobile, haptic patterns