Getting started

Getting started

Install the package and turn any button into a hold. Your code decides what happens after.

Install

npm install @reuse-sh/interactions

Use it

The browser module works without a framework. In React, the component creates the same controller when it mounts and destroys it when it unmounts.

import { createHoldToConfirm } from "@reuse-sh/interactions";
import "@reuse-sh/interactions/styles.css";

const hold = createHoldToConfirm(button, {
  holdMs: 1200,
  onConfirm: () => removeDraft(),
});