Component packs › Spool › Eject Modal

Eject Modal

Press Eject and the smoked door swings out on a damped hinge while the cassette rises; the question and its answers are written on the label.

Eject Modal is a dialog from Spool, a component pack with 6 deck controls: Controls built from the mechanics of a tape deck: latching keys, reels, drums and a VU needle. Price: $2 for the whole pack.

Built with: damped hinge door, dialog on a cassette label, focus in and back out.

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.

Eject Modal props

PropTypeDefaultDescription
titlestringQuestion on the label.
bodystringOne or two lines under it.
confirmstring"Replace"Confirm button. Default "Replace".
cancelstring"Keep"Cancel button. Default "Keep".
triggerstring"Eject"Trigger key label. Default "Eject".
onConfirm() => void
onCancel() => void
onOpenChange(open: boolean) => void
darkboolean
autoplaynumber | falseShowcase mode: opens and closes every N ms.

Methods on the ref

Use it in React

import EjectModal from './EjectModal';

<EjectModal />

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

More in Spool

Good for: Skeuomorphic UI.