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

Terminal
npx airflib@latest add hold-to-confirm

Usage

TSX
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.

NameTypeDefaultDescription
tone"light" | "dark""light"Paint for a light or a dark page; every colour is a token too.
filledbooleantrueA 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).
holdMsnumber1500msHow long it takes to fill, in milliseconds. From 600 to 3000ms.
radiusnumber22pxCorner 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.