Side Panel
A non-modal inspector beside a list: a named complementary region, Escape closes it and returns focus to the row, shortcuts declared inside run while it is open, and on narrow screens it stacks below the list, overlays it or opens as a bottom sheet.
Example
- SUP-201
- SUP-198
- SUP-190
side-panel-demo.tsxCopy code
Installation
Copy code
npm packages
lucide-reactclass-variance-authority@0.7.1Usage
ImportCopy code
An inspector beside a list: open it from a row's onSelect, pass returnFocus to the row, and give its buttons a shortcut.
API reference
SidePanel
| Prop | Type | Default |
|---|---|---|
openrequired | boolean | – |
onOpenChangerequired | (open: boolean) => void | – |
titlerequired | ReactNode | – |
description | ReactNode | – |
actionsButtons for the header, after the title. | ReactNode | – |
returnFocusWhere focus goes when the panel closes with focus inside it: the row that opened it. | () => HTMLElement | null | undefined | – |
scopeThe `ShortcutScope` name of the panel; its shortcuts run while it's open. | string | "side-panel" |
scopeLabelHow the `ShortcutsDialog` titles the panel's shortcuts; defaults to a plain-text `title`. | string | – |
narrowWhere the panel goes on narrow screens; `"stack"` by default. | "stack" | "overlay" | "sheet" | "stack" |
labels | Partial<SidePanelLabels> | – |
className | string | – |
children | ReactNode | – |
Other exports
sidePanelLabelsnarrowQueryuseMediaQuerytype SidePanelLabelstype SidePanelNarrowtype SidePanelPropsAccessibility
- A non-modal complementary region named by its title, so the list beside it stays usable.
- Escape closes it; focus that was inside returns to the row that opened it.
- On narrow screens narrow="stack" (default) keeps it in the flow below the list, hiding nothing and trapping no focus; "sheet" is a modal bottom sheet that takes focus and gives it back.
Agent actions
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.