BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/neon-ui/confirm-dialog

ConfirmDialog

neon-ui/confirm-dialog
FreeComponent

Destructive confirmation modal armed by press-and-hold, with keyboard hold support.

Install it

npx shadcn@latest add https://ui.neon.com/r/confirm-dialog.json

Source

src/components/confirm-dialog/confirm-dialog.tsxui.neon.com/r/confirm-dialog.json · first 6 KB
1"use client";
2
3import type { CSSProperties, KeyboardEvent, ReactNode } from "react";
4import { useEffect, useRef, useState } from "react";
5
6import { Button } from "@/components/ui/button";
7import {
8 Dialog,
9 DialogContent,
10 DialogDescription,
11 DialogFooter,
12 DialogHeader,
13 DialogTitle,
14} from "@/components/ui/dialog";
15import { cn } from "@/lib/utils";
16
17export interface ConfirmDialogProps {
18 open: boolean;
19 onOpenChange: (open: boolean) => void;
20 /** Runs after the hold completes; the dialog closes itself. */
21 onConfirm: () => void;
22 /** One line naming the action, e.g. "Restore this checkpoint?". */
23 title: string;
24 /** What happens and what it costs — say it plainly. */
25 description?: ReactNode;
26 /** Label inside the hold action. */
27 confirmLabel?: string;
28 cancelLabel?: string;
29 /** How long the hold takes to arm, in milliseconds. */
30 holdMs?: number;
31 /**
32 * The hold trembles as it approaches commitment — barely a shiver
33 * at the start, unmistakable by the end. Off under reduced motion.
34 */
35 shake?: boolean;
36}
37
38/* ─────────────────────────────────────────────────────────
39 * HOLD-TO-CONFIRM STORYBOARD
40 *
41 * A destructive action shouldn't be one twitch away. The
42 * dialog asks; the hold answers.
43 *
44 * open overlay fades, the panel rises 8px
45 * rest the action wears destructive as a border and
46 * text — armed, not fired
47 * hold press and hold: a destructive fill sweeps
48 * left to right for exactly holdMs (linear —
49 * progress, not easing). The fill carries its
50 * own destructive-foreground copy of the label,
51 * revealed by the same clip-path, so the sweep
52 * edge crosses the letterforms — white behind
53 * it, destructive ahead of it, never a flip.
54 * With shake on, the button trembles harder as
55 * the fill closes in — amplitude eases from 0
56 * to 2.5px over the hold (ease-in: dread builds
57 * late), mixing axes so it reads as strain
58 * release let go early and the fill springs back
59 * (180ms ease-out) — no harm done
60 * arm the fill lands, onConfirm fires once, the
61 * dialog closes
62 * keyboard holding Space or Enter works the same way;
63 * key repeat is ignored
64 *
65 * The clip-path label split was suggested by Gurbinder
66// … truncated

What it pulls in

Other registry items

  • utils
  • https://ui.neon.com/r/neon-tokens.json
  • https://ui.neon.com/r/button.json
  • https://ui.neon.com/r/dialog.json

Files it writes

  • src/components/confirm-dialog/confirm-dialog.tsx

Facts

Registry
neon-ui
Type
registry:component
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-10
Last confirmed
today

Go to the source

ui.neon.com neondatabase/ui on GitHub Raw registry item This item as JSON

More from neon-ui

All 77 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
ActivityFeedactivity-feedneon-uiComponentsFree2 deps
AgentChatagent-chatneon-uiComponentsFree6 deps
AnimatedWashanimated-washneon-uiComponentsFreeno deps · 2 files
ApiKeyListapi-key-listneon-uiComponentsFree2 deps
AppCardapp-cardneon-uiComponentsFree2 deps
AppCreatorapp-creatorneon-uiComponentsFree2 deps
AuthFormauth-formneon-uiComponentsFreeno deps
AutoscaleChartautoscale-chartneon-uiComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex