Component packs › Dovetail › Sliding-lid Box

Sliding-lid Box

The maple lid slides out along its grooves to show the message on a felt lining; a real modal with focus kept inside.

Sliding-lid Box is a modal from Dovetail, a component pack with 6 woodwork controls: Dropdowns, toggles, tabs and dialogs made of real-looking oak, walnut and maple. Price: $2 for the whole pack.

Built with: grooved lid slide, felt lining in the pack colour, focus trap.

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.

Sliding-lid Box props

PropTypeDefaultDescription
triggerstring
titlestring
textstring
confirmstring
darkbooleanfollows the pageForce the dark (true) or light (false) look. Default: follows the page.
onConfirm() => void
autoplaynumber | falseShowcase mode: opens and closes every N ms while visible.

Methods on the ref

Use it in React

import SlidingLidBox from './SlidingLidBox';

<SlidingLidBox />

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

More in Dovetail

Good for: Menus and popovers, Skeuomorphic UI.