Skip to content

Slide Drawer

A full-height side panel slides over a softened backdrop with native modal focus.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import SlideDrawer from "./SlideDrawer";
export default function Example() {
return (
<SlideDrawer
trigger={"Open studio notes"}
title={"Studio notes"}
children={"Objects with intention.\n\nA collection of considered shapes, materials and interactions.\n\nEvery detail has a purpose. Every component is yours to make your own."}
footer={"A little room for the details."}
label={"Studio notes"}
closeLabel={"Close panel"}
side={"right"}
width={420}
color={"#d4bea6"}
background={"#26221e"}
/>
);
}

Using Slide Drawer

Use trigger for an optional launcher or control open from your own interface. Put content in children and persistent actions in footer.

The native modal dialog traps focus and closes on Escape or a backdrop click. When controlled, update open in onOpenChange to accept the requested state.

Props

NameTypeRequiredDefaultDescription
triggerReactNodeNoundefinedOptional button content to open the drawer.
childrenReactNodeNoundefinedScrollable panel content.
titleReactNodeNoundefinedPanel heading; string titles also name the dialog.
footerReactNodeNoundefinedOptional footer content.
openbooleanNoundefinedControlled open state.
defaultOpenbooleanNofalseInitial uncontrolled open state.
onOpenChangefunctionNoundefinedReceives requested open and close states.
closeLabelstringNo"Close panel"Close button label.
labelstringNo"Panel"Accessible dialog name when title is not a string.
side"right" | "left"No"right"Edge from which the panel enters.
widthnumberNo420Panel width in pixels, capped by the viewport.
colorstringNo"#d4bea6"Accent and focus colour.
backgroundstringNo"#26221e"Panel surface colour.
classNamestringNo""Additional classes on the root element.
styleCSSPropertiesNoundefinedInline styles for sizing, typography and appearance.

Related components

Peek Popover

Overlays

A compact disclosure opens into a softly hinged floating surface.

A searchable command menu with grouped actions and keyboard navigation.

Nebula Modal

Overlays

A controlled dialog with a soft coloured backdrop.

Lava Lamp

Backgrounds

Warm liquid forms merge and drift inside a softly lit glass lamp.