Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

Side panel

A sheet for one record: badges, doors out to other tools, a copy-a-prompt handoff and a stats strip.

Installation

pnpm add @heyramzi/ui

Usage

import { SidePanel } from "@heyramzi/ui/panel";
<SidePanel
  bind:open
  title="Write the pricing page"
  description="Ada, due Friday"
  badges={[{ label: "In review", tone: "warning" }]}
>
  <p>The record's fields go here.</p>
</SidePanel>

Keyboard and accessibility

Key Does
Tab Moves focus to the next control inside the panel.
Shift Tab Moves focus to the previous control inside the panel.
Esc Closes the panel and returns focus to what opened it.
  • It's a dialog named by its title and described by its description.
  • On open, focus goes to the panel itself, or to the first field when a text field comes first.
  • Tab can't leave the panel while it's open.
  • The close button is named "Close". Open-in links open a new tab and are named by their label.

API reference

open required bindable boolean
title required string
Names the dialog for screen readers and heads the panel.
titleClass string
Merged onto the title. A short path is set `font-mono`, a subject is not.
description string
The facts the record is filed under, read out under the title.
badges { label: string; tone: Tone }[]
Default []
Status chips, left of the action row.
openIn { tool: OpenInTool; href: string; label: string; text?: string }[]
Default []
Doors out to another tool. `text` replaces the tool's name on the button.
handoff { value: () => string | Promise<string>; label: string; copiedLabel: string }
A prompt for an AI about this record, copied on click.
stats PanelStat[]
Default []
The record's numbers, as a strip under the badges. Same place in every panel.
actions Snippet
Anything else the record can do, drawn last in the action row.
footer Snippet
Pinned actions. The body scrolls above it; the caller aligns the row.
children required Snippet
width "sm" | "md" | "lg" | "xl" | "2xl"
Default "sm"
bare boolean
Default false
The body brings its own header: the title is read out but not drawn, and the body is neither padded nor scrolled by the panel.
onOpenChange (open: boolean) => void
Called with the new state when the close button, Escape or the overlay closes the panel.
Prop Type Default
open required bindable boolean
title required

Names the dialog for screen readers and heads the panel.

string
titleClass

Merged onto the title. A short path is set `font-mono`, a subject is not.

string
description

The facts the record is filed under, read out under the title.

string
badges

Status chips, left of the action row.

{ label: string; tone: Tone }[] []
openIn

Doors out to another tool. `text` replaces the tool's name on the button.

{ tool: OpenInTool; href: string; label: string; text?: string }[] []
handoff

A prompt for an AI about this record, copied on click.

{ value: () => string | Promise<string>; label: string; copiedLabel: string }
stats

The record's numbers, as a strip under the badges. Same place in every panel.

PanelStat[] []
actions

Anything else the record can do, drawn last in the action row.

Snippet
footer

Pinned actions. The body scrolls above it; the caller aligns the row.

Snippet
children required Snippet
width "sm" | "md" | "lg" | "xl" | "2xl" "sm"
bare

The body brings its own header: the title is read out but not drawn, and the body is neither padded nor scrolled by the panel.

boolean false
onOpenChange

Called with the new state when the close button, Escape or the overlay closes the panel.

(open: boolean) => void