Drawer
A panel that slides in from an edge of the screen without fully covering what’s behind it. For secondary or long content—filters, a cart, navigation, details—where keeping the context matters. It uses the same <dialog> engine as the Modal.
Overlays · TaishoDS Core, in plain HTML.
Examples
One working example per case. Each example is the HTML of its preview—copy it as is, and with Core’s CSS and JS loaded, it looks and works the same.
Filters side panel
Not dismissible with its own name
Class reference
Every value of each modifier, with its HTML ready to copy.
Side
Which screen edge the panel slides in from. Open each one to see it.
Size
The panel’s width (or height, if it slides in from the top or bottom).
Combinations
Side and size combined.
When to use
- The content is long, or it helps to keep a sense of where it came from.
- Filters, navigation, a cart, or a side detail that opens and closes often.
- On small screens, where an edge-to-edge panel works better than a centered box.
When not to use
- The task is brief and deserves the screen’s full attention →
modal. - It’s a yes/no confirmation →
alert-dialog. - It’s only a menu of actions anchored to a trigger →
menuorpopover.
Do
- Choose the side deliberately (
side-left,side-right…)—navigation at the start, details and filters at the end (RTL-aware). - Give it a header with a title and an explicit close button, in addition to Esc.
Don’t
- Don’t put the page’s main task in a drawer. If it’s the core work, it belongs on the page.
- Don’t use it for a passing notice—that’s a
toastor abanner.
TaishoDS Core
Doesn’t need our JavaScript—the browser handles it.
It’s a <dialog> with invoker commands (commandfor), with CSS transforms to slide in from the side.
Limitation
From the CDN, without a build, load taisho.drawer.css along with taisho.base.css. Also load:
taisho.button.csstaisho.icon.csstaisho.modal.csstaisho.spinner.css
For how Core works in general, see Behavior.
Accessibility
Implements the Modal Dialog pattern from the WAI-ARIA APG.
- Same model as the Modal—a
<dialog>opened withshowModal(). The browser provides the dialog role, traps focus, makes the backgroundinert, and returns focus to the trigger on close. In WebKit, when the dialog was opened with the mouse, focus does not return to the trigger on close, because Safari does not focus a button on click. - Accessible name. With the component’s own title, the
<dialog>carriesaria-labelledbypointing to it. With a custom header, the name has to come fromaria-labelledby(pointing to the header’s title) oraria-labelon the<dialog>. With neither (atitleattribute also counts as a name), Core warns in the console when the page is served fromlocalhost. - Not dismissible:
closedby="none"on the<dialog>. The browser doesn’t close it with Esc or the backdrop. Where the browser ignores it, thecancelevent and the Esc keystroke are prevented. Only its own buttons close it, and the × button is hidden. - While the panel is open, the page behind it doesn’t scroll and keeps the scrollbar’s space (
scrollbar-gutter: stable), so the content doesn’t shift. - It lives in the top layer, without a portal or
z-index. The slide-in comes from@starting-style, based on the side (side-left,side-right,side-top, orside-bottom).
Keyboard
On top of what the browser already does (Tab moves focus, Enter activates a button).
| Key | What it does |
|---|---|
| Esc | Closes the panel. If it isn’t dismissible (closedby="none"), it does nothing, not even on a second Esc in a row. |
Verification
What was actually tested. Anything that wasn’t tested says so—we’d rather say “not verified” than claim too much.
- axe WCAG 2.2 A + AA in a real browser, in light and dark mode, before every release.
- keyboard Key map documented above, checked against the component.
- screen reader Not verified with a screen reader. Test it in your own combination of components, not just here, where each one appears alone and on its happy path.