Skip to content
Eskais UI

Layout

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

Installation

npx shadcn@latest add @eskais/side-panel
npm packageslucide-reactclass-variance-authority@0.7.1

Usage

Import
import { SidePanel, sidePanelLabels } from "@/components/ui/side-panel"import { narrowQuery, useMediaQuery } from "@/components/ui/use-media-query"

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

PropTypeDefault
openrequiredboolean–
onOpenChangerequired(open: boolean) => void–
titlerequiredReactNode–
descriptionReactNode–
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"
labelsPartial<SidePanelLabels>–
classNamestring–
childrenReactNode–

Other exports

sidePanelLabelsnarrowQueryuseMediaQuerytype SidePanelLabelstype SidePanelNarrowtype SidePanelProps

Accessibility

  • 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.