# Delete Button

Delete Button is a free, MIT-licensed standalone component from AI Canvas (https://aicanvas.me): it belongs to no design system and works in any React + Tailwind app. Index of every component and install setup: https://aicanvas.me/llms.txt

A red button that starts a five-second delete countdown, with a one-tap undo.

- Category: Buttons & Toggles
- Built with: Motion, Tailwind CSS
- License: MIT
- Page: https://aicanvas.me/components/delete-button

## Install

```bash
npx shadcn@latest add @aicanvas/delete-button
```

Needs a free AI Canvas account. Signed out, the command exits 0 but writes a placeholder (an `AccountRequired` notice); check for it before reporting success. Token setup: the Install section of https://aicanvas.me/llms.txt.

AI agents can also get its install command from the read-only AI Canvas MCP server (`npx -y @aicanvas/mcp`) and run it. Setup: https://aicanvas.me/mcp

Peer dependencies:

```bash
npm install framer-motion
```

## Use it

It installs to `components/aicanvas/delete-button.tsx` (under `src/` if your project has one). With the usual `@/` alias:

```tsx
import DeleteButton from '@/components/aicanvas/delete-button'

<DeleteButton />
```

It takes no props.

## About

Delete Button turns a destructive action into a single morphing pill instead of a confirm dialog. Click it and the red button reshapes into a soft-red "Cancel Deletion" pill with a live five-second countdown badge that rolls down digit by digit, plus an undo arrow. Let it run out and the pill settles into a muted "Account Deleted" state before resetting; tap undo at any point and it springs straight back to default. Framer Motion drives the shape-morph between all three pills with one shared layout transition. It is a calmer alternative to a browser confirm() for account deletion, removing a project, or any other destructive action.

Use cases: Account settings, Admin panel, Confirmation flow.

## Source

Install with the command above to get the source.

## Remix prompt

Only when the user wants Delete Button rebuilt from scratch instead of installed: its remix prompt is in the Remix panel at https://aicanvas.me/components/delete-button.

## Related

- [Pill Toggle](https://aicanvas.me/components/pill-toggle.md): A minimal iOS-style slider toggle: thumb glides between off (grey) and on (green) with a snappy spring. Fully responsive.
- [Mark Toggle](https://aicanvas.me/components/mark-toggle.md): An iOS-style pill toggle in warm earth and sand tones: the thumb carries a small icon that morphs from X to checkmark as it slides across.
- [Taga Toggle](https://aicanvas.me/components/taga-toggle.md): A playful pill toggle with an expressive face on the thumb: dead (×× eyes, flat mouth) when off, happy (arc eyes, big smile) when on. Track warms from grey to yellow.
- [Blind Pull Toggle](https://aicanvas.me/components/blind-pull-toggle.md): A dark/light mode toggle styled as a window-blind pull cord. Click to yank the cord and watch the icon swap through a venetian-blind slat animation.
- [Glitch Button](https://aicanvas.me/components/glitch-button.md): A terminal-inspired button with a text scramble glitch effect on hover.
