Purge
Delete workspace
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initCardPurge(el) on the mounted element instead.
Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/card-purgeAbout this component
A delete confirmation you have to mean: hold the button and it fills with small red cells from the left while the seconds count down, and letting go drains them. Hold to the end and the cells burst, the workspace row folds away and the card offers Undo.
Triggers
- Click
- State change
- Card
- Fill
Techniques
- requestAnimationFrame
- CSS transition
- State machine
- Gradient
Difficulty
Advanced
Accessibility
Keyboard and screen readers
The hold button is a native button named Delete workspace. Press and hold for 1.6 seconds to confirm, and it works with Space or Enter held as well as a pointer; the title sits in an aria-live region so Workspace deleted is announced; Undo is a native button and focus returns to the hold button after it.
Reduced motion
The hold still fills the button (the fill is the feedback) but there is no burst and the row folds at once.
Use it in anything you build, commercial and client work included. Licence
More cards
See all- Billing redesign
- Onboarding copy
- Sync notes