App components / Slide-out panels
Slide-out panel
The Modal's anatomy docked to the side at full height: the title on the tray with an esc key, the content in a scrolling raised card, the actions on the tray below with a ⌘ ↵ hint.
MembersReact · Vue · HTMLFigma: Slide-out panels
Code
The component itself, ready to drop into your project. Switch between React, Vue and plain HTML; every version uses the same Tailwind classes on Ochre's tokens.
Installation
Examples
Form panel
A short create form: the title field takes focus, actions on the tray with the shortcut in mono, ⌘ ↵ creates.
Edit form
Fields in the card, ⌘ ↵ saves.
Motion
Built on Ochre's ease-out curves. With reduced motion switched on, everything still works, it just doesn't move.
01The panel slides all the way in from its edge with a slower ease-out while the page behind dims.
02The card inside rises into place 90 ms later.
03Closing accelerates away in 200 ms, quicker than opening.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| open | boolean | – | Whether the panel is showing. |
| onClose | () => void | – | Called on esc, the esc key, or a click on the backdrop. |
| title | ReactNode | – | What the panel shows: a record's name or what you're editing. |
| context | ReactNode | – | Mono line at the top of the card: id, status, owner. |
| actions | ReactNode | – | Buttons on the tray below, quiet first and the confirming one last. |
| onConfirm | () => void | – | Runs on ⌘↵ / Ctrl+Enter and shows the hint. |
| hint | ReactNode | – | Replaces the keyboard hint on the left of the footer. |
| headerActions | ReactNode | – | Small controls before the esc key, such as previous and next. Use SlideOutAction for them. |
| pinned | ReactNode | – | Pinned to the foot of the card under a hairline while the body scrolls, such as a comment composer (Vue: the pinned slot). |
| SlideOutAction | ButtonHTMLAttributes | – | A 24 px key-style button for headerActions, matching the esc key. Give it an aria-label. |
| size | "s" | "m" | "l" | "m" | 380, 440 or 560 pixels wide; full width less 8 px on phones. |
| side | "right" | "left" | "right" | Which edge it docks to. |
Usage
Use it for
- Details of a row or card that people read alongside the list: an issue, a customer, an invoice.
- Longer edit forms that would crowd a Modal.
Avoid
- Quick yes-or-no decisions: use a Modal.
- Panels that open more panels. Swap the content instead, with previous and next on the title strip.
- A corner X: close with the esc key on the title strip.