Component packs › Slate › Eraser Undo

Eraser Undo

A felt eraser sweeps along a deleted line and wipes it to dust; Undo writes it back in, left to right.

Eraser Undo is an undo from Slate, a component pack with 6 chalkboard components: Controls written in chalk on a slate: strokes that draw themselves and rub out to dust. Price: $2 for the whole pack.

Built with: eraser sweep, chalk write-back, undo window.

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.

Eraser Undo props

PropTypeDefaultDescription
itemsstring[]
undoFornumber6Seconds Undo stays available. Default 6.
widthnumber380Board width in px. Default 380.
darkboolean
onRemove(text: string) => void
onUndo(text: string) => void
autoplaynumber | falseShowcase mode: erases and restores lines every N ms while visible.

Methods on the ref

Use it in React

import EraserUndo from './EraserUndo';

<EraserUndo />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Slate

Good for: Checkboxes.