Hold to confirm
A button that acts only once it is held: it sinks under the finger while a ring runs round its edge, and letting go early runs it back.
Install
npx airflib@latest add hold-to-confirm
Usage
import { HoldToConfirm } from "@/components/airflib/components/hold-to-confirm";
<HoldToConfirm
tone="light"
filled={false}
holdMs={1500}
radius={22}
/>
API
Its main settings, read from the code: each prop's type and default. The prompt lists every prop.
| Name | Type | Default | Description |
|---|---|---|---|
tone | "light" | "dark" | "light" | Paint for a light or a dark page; every colour is a token too. |
filled | boolean | true | A solid fill, for the main action. Off, there is no fill at all: the track round its edge is its shape and the ring its charge (a "Skip" over a video). |
holdMs | number | 1500ms | How long it takes to fill, in milliseconds. From 600 to 3000ms. |
radius | number | 22px | Corner radius in pixels, 22 being a pill. Inside a flow, the flow's radius applies until this is set. From 0 to 22px. |
Sound
The sounds in the catalog are the site's. The block comes silent, with a place for your own.