Drawer Component

Pure CSS drawer built with .drawer + .drawer-wrapper structure. Toggled by adding / removing the .drawer-open class.

Notes

Available child nodes of .drawer:

Basic usage

Complete structure with tools, title, body, footer and note.

Drawer Title

Full drawer structure with header, body, footer and note.

This is a note

Positions

4 positions are supported, the default is drawer-end.

end (default)

Drawer sliding in from the end edge (default).

top

Drawer sliding in from the top edge.

bottom

Drawer sliding in from the bottom edge.

start

Drawer sliding in from the start edge.

Width

drawer-100

Width = 100 spacing units (100 * 4px).

drawer-scale

Width = --default-width-input.

drawer-scale-2

Width = 2 × --default-width-input.

drawer-full

Full horizontal width minus side gaps.

Tools outside

When the content fills the drawer, you may want to move the tools outside the wrapper.

.drawer-tools-outside places the tools bar outside / beside the wrapper.

Tools outside

Tools bar is placed outside the wrapper on the side.

Drawer inside a container (Absolute)

.drawer-absolute confines the drawer inside a relative container. Close the drawer, then reopen it from the button inside the box.

Absolute drawer

Drawer confined inside the relative container above.

Full-size media

drawer-media displays a single media item (image, video or iframe). The .drawer-body padding becomes 0 so the media fills the drawer.

A picture
A note

Rounded corners

.drawer-rounded applies the corner radius to the visible edge of the wrapper.

end-rounded

Rounded corners on the end-edge (left in LTR).

start-rounded

Rounded corners on the start-edge (right in LTR).

top-rounded

Rounded corners on the top edge (bottom corners).

bottom-rounded

Rounded corners on the bottom edge (top corners).

Footer with complete actions

Full .actions bar with start / center / end groups inside .drawer-footer.

Actions footer

Full actions bar with start / center / end groups.

Footer with .btns .btns-flush

Use .btns.btns-flush inside .drawer-footer — the group fills the footer edge-to-edge (no padding).

Btns flush footer

Footer using a flush button group.

Simplified structure

.drawer-title, .drawer-header, .drawer-tools, .drawer-footer, .drawer-backdrop and .drawer-note are all optional.

Drawer without .drawer-title — the empty header collapses.

Drawer without .drawer-header.

No tools

Drawer without .drawer-tools.

Drawer without .drawer-backdrop — surrounding content stays interactive.