DrawerPro
A temporary side surface built on the sheet: titled header that doubles as the drag handle, flick or drag past a third to close, any edge.
oxyn add drawerThe drawer opens inside this window. Drag its header toward the edge, press Escape or the close button.
The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- A temporary side surface for focused work next to the transcript: run details, a file preview, a settings panel.
When not to use
- The dialog docked to an edge for inspectors and run details: use Sheet instead.
- A sheet that rests at a peek or full height and follows your finger: use Bottom sheet instead.
- An assistant docked beside a page: use AI side panel instead.
Installation
Drawer is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add drawerUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Right
From the right edge.
The drawer opens inside this window. Drag its header toward the edge, press Escape or the close button.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Bottom
A bottom drawer.
The drawer opens inside this window. Drag its header toward the edge, press Escape or the close button.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Inset
Floating inset panel.
The drawer opens inside this window. Drag its header toward the edge, press Escape or the close button.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
Drawer
| Prop | Type | Default | Description |
|---|---|---|---|
titlerequired | String | — | Title. |
description | Option<String> | Default::default() | Description. |
side | String | "right" | `right` · `left` · `top` · `bottom`. |
trigger_label | String | "Open drawer" | Trigger label. |
size | f32 | 380.0 | Width / height px. |
inset | bool | Default::default() | Floating inset panel. |
contained | bool | Default::default() | Contained. |
footer | Option<String> | Default::default() | Footer action. |
childrenrequired | Element | — | Body. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Escape | Close and return focus to the trigger |
| TaborShiftTab | Cycle inside the drawer |
Accessibility
- role=dialog with aria-modal, title and description wired.
- Close button labelled; dragging is never the only way to close.
From the spec
Dialog semantics with the title and description wired; close button labelled; dragging is never the only way out.
Motion & interaction
Springs in from its edge and leaves faster; the header is the drag handle and rubber-bands away from the edge. Inside previews it is contained so it never covers the page.
Timing
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Enter | 280 ms | spring | fade |
| Exit | 200 ms | ease.in | fade |
| Scrim | 200 ms | linear | linear |
Responsive behaviour
- Side drawers cap at the window width minus a gutter; top / bottom span the width.
Edge cases (spec)
Side drawers cap at the window minus a gutter; top / bottom span the width and cap at 32rem. Start-open demos render inside an app frame.
Notes for AI
- Import
Drawerfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
SheetElinoxyn_gpui. - Props to set first:
title,children. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.