WidgetFrame
The shell every dashboard widget sits in, with per-widget loading/empty/error states.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
The shell every dashboard widget sits in, with per-widget loading/empty/error states.
Accessibility
Fully keyboard operable: Tab to focus, Enter/Space to activate. The visible focus ring uses --focus-ring — never remove it. Provide an accessible label (aria-label) for icon-only controls.
Install and import
npx shadcn@latest add @prism/widget-frame
import { WidgetFrame } from '@/components/prism/WidgetFrame';
In a no-build prototype, read it from the bundle instead: const { WidgetFrame } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
title | React.ReactNode | — | |
subtitle | React.ReactNode | — | |
actions | React.ReactNode | — | Right-aligned header controls — a menu, a unit toggle, a link out. |
footnote | React.ReactNode | — | Small print under the body: source, refresh time, caveat. |
state | "ready" | "loading" | "empty" | "error" | — | Per-widget state. One failing query degrades one card, never the page. |
error | React.ReactNode | — | |
emptyMessage | React.ReactNode | — | |
onRetry | () => void | — | |
skeleton | "chart" | "table" | "kpi" | "text" | — | Skeleton silhouette while loading — shaped like the content it replaces. |
size | "full" | "two-thirds" | "half" | "third" | "quarter" | — | Width as a SEMANTIC size, which each breakpoint maps to columns itself. A raw column count cannot survive a change of denominator — 4-of-12 is a third, the same 4 against 6 columns is two thirds. |
span | number | — | Escape hatch: a raw 1–12 column span. Prefer size. |
rows | number | — | Row span, for widgets that need extra height. |
children | React.ReactNode | — | |
className | string | — |