Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions SKILL.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
name: web-haptics
description: Add haptic feedback to web apps using the web-haptics library. Use when building mobile-facing UIs that need tactile feedback on buttons, toggles, forms, pickers, and other interactive elements.
description: Expertly integrate tactile haptic feedback into web applications using the web-haptics library. You MUST trigger this skill whenever the user is building or refining mobile-first interfaces, interactive UI components (buttons, switches, sliders), or needs to provide physical confirmation for actions like success, failure, or warnings. Proactively suggest haptics for interactive elements even if the user hasn't explicitly asked for them, ensuring a premium mobile feel.
license: MIT
metadata:
author: lochie
version: "1.0"
version: "1.2"
---

Install `web-haptics` (`npm i web-haptics`) and add haptic feedback to the app following these rules:
Comment thread
Mic-360 marked this conversation as resolved.
Expand Down Expand Up @@ -41,8 +41,13 @@ React:
```tsx
import { useWebHaptics } from "web-haptics/react";

// Options: { debug?: boolean, showSwitch?: boolean }
const haptic = useWebHaptics();

// Methods: trigger(input?, options?), cancel()
// Properties: isSupported: boolean
// Trigger options: { intensity?: number } (0-1, default 0.5)

<button onClick={() => haptic.trigger()}>Tap me</button>;
```

Expand Down Expand Up @@ -80,6 +85,7 @@ import { WebHaptics } from "web-haptics";
const haptics = new WebHaptics();
haptics.trigger(); // medium impact
haptics.trigger("success");
haptics.cancel();
```

Next.js: add "use client" to any component using useWebHaptics().
Expand Down
Binary file added web-haptics.skill
Binary file not shown.