Skip to content

    Browse components

    Fling Confirm

    Slide-to-confirm track: the knob stretches as you fling it, commits past the threshold with a popping check, and springs home with a wobble if you let go early.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/fling-confirm

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/fling-confirm.json

    Usage

    import { FlingConfirm } from "@/components/ui/fling-confirm";
    
    <FlingConfirm label="Slide to pay" confirmedLabel="Paid" onCommit={() => pay(invoice.id)} />

    Props

    PropTypeDefaultDescription
    labelstring"Slide to confirm"Track label.
    confirmedLabelstring"Confirmed"Label after committing.
    colorstring"#22c55e"Fill color.
    thresholdnumber0.9Fraction of the track to pass to commit on release.
    resetAfternumber2500Ms before resetting after commit; 0 stays committed.
    onCommitReactNode—Called once the knob reaches the end.
    classNamestring—Extra classes for the root element.