Dust Delete
betaDeletes an item by turning it to dust: the row breaks into tiles of its own content that drift away, then it closes.
- Effects & motion
- 1 file
- No extra npm packages
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add dust-deleteNo npm packages are needed beyond what Dowel already requires.
import { DustDelete } from "@/components/ui/dust-delete";Default
Imperative
<DustDelete>
| Prop | Type | Default |
|---|---|---|
children (required) | ReactNode | — |
actionRefImperative handle, for deleting without owning a | Ref<DustDeleteHandle> | — |
announcementAnnounced politely when the item goes. Default "Deleted". | string | "Deleted" |
deletedTurn the item to dust when this becomes true. | boolean | false |
durationHow long the dust drifts, in ms at normal motion. Default 1100. | number | 1100 |
onDeletedCalled once the item has closed. Remove it from your list here. | () => void | — |
Plus every attribute of <div> except children.
The deletion is announced through a polite role="status" region ("Deleted", or `announcement`). The dust is an aria-hidden layer of inert copies, so nothing in it can be focused, read or clicked, and the item itself goes inert as soon as the effect starts. Move focus somewhere sensible in `onDeleted` — the next row, or the list — since the deleted item's controls disappear. Every duration follows --motion-scale; under reduced motion there is no dust, only a short fade and close.
7/7
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — does not apply
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes