Skip to main content

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 bar
Live demo
Open ↗

When 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​

PropTypeRequiredDescription
titleReact.ReactNode—
subtitleReact.ReactNode—
actionsReact.ReactNode—Right-aligned header controls — a menu, a unit toggle, a link out.
footnoteReact.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.
errorReact.ReactNode—
emptyMessageReact.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.
spannumber—Escape hatch: a raw 1–12 column span. Prefer size.
rowsnumber—Row span, for widgets that need extra height.
childrenReact.ReactNode—
classNamestring—