Haptics.
Feedback you can choose.
Meaningful events, optional device adapters, and visual feedback that always stands on its own.
Meaningful feedback, optional delivery
Selection, toggle, snap, success and warning describe events, not hardware. The optional feedback entry defaults to no output. Enable vibration only by choice; reduced motion or effects suppress it. The visual result never depends on device feedback.
Feedback is optional. Every action has a visible result.
Vibration depends on browser, device and permissions. No delivery is guaranteed.
import "@dixy-ui/react/styles.css";
import { Theme } from "@dixy-ui/react";
import { useState } from "react";
import {
Button,
Inline,
Stack,
Text,
Theme as FeedbackScope,
} from "@dixy-ui/react";
import {
FeedbackProvider,
useFeedback,
vibrationAdapter,
} from "@dixy-ui/react/feedback";Provider API
| Property | Type | Default |
|---|---|---|
children | ReactNode | โ |
enabled | boolean | undefined | false |
adapter | FeedbackAdapter | undefined | โ |
Events and adapters
| Event | Meaning | Web fallback in ms |
|---|---|---|
selection | A discrete selection changed | 8 |
toggle | A setting changed | 10 |
snap | A meaningful detent was reached | 6 |
success | An operation completed | 10, 40, 10 |
warning | An action needs attention | 20, 50, 20 |
A native host can supply its own FeedbackAdapter. The provider requires explicit opt-in; omitting the adapter does nothing. Synchronous throws and rejected adapter promises are isolated from application actions. Emit after a confirmed change, never on focus or every pointer movement. Browser vibration is best effort and cannot reproduce native Core Haptics.