Component packs › Fidget › Trash Icon
The lid swings open on its hinge, a crumpled sheet drops in and bounces, and the lid slams shut with a jolt.
Trash Icon is an action from Fidget, a component pack with 10 animated icons: Animated icons with working parts: hinges, pendulums, springs and gravity. Price: $2 for the whole pack.
Built with: hinge spring, gravity and bounce, waits for your action.
Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.
| Prop | Type | Default | Description |
|---|---|---|---|
action | () => unknown | Runs on press; the lid stays open until a returned promise settles. | |
disabled | boolean | ||
label | string | Accessible name. | |
size | number | Scale factor. 1 = 56 px button. | |
onDelete | () => void | ||
autoplay | number | false | Showcase mode: throws something away every N ms while visible. |
play(): void: Plays the throw-away without calling the action.destroy(): voidimport TrashIcon from './TrashIcon';
<TrashIcon />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Animated icons.