Panel Card
A panel on a Card — a dashboard chart or table, or one resource and its status (a contract, the current plan) — with a standard header and a body that handles its own states.
Overview
PanelCardHeader
- `title`: a heading,
headingLevel2 by default. - `icon`: shown in a
softIconTile. - `description` and `status`: a
Badgenext to the title. - `help`: opened by an ⓘ button in a popover, so it works with touch and keyboard.
- `updatedAt`: a
Dateor timestamp, formatted withIntlin the react-aria locale;isRefreshingshows a spinner next to it while the content stays on screen. - `toolbar`: a slot for the card's own controls, which wraps below the title on narrow cards.
PanelCardBody
Shows the first state that applies — isLoading (skeleton, first load only), isError (message plus "Try again" with onRetry), isEmpty (Empty) — or its children. emptyState/errorState replace the built-in messages (e.g. a missing resource with the action that adds it).
What goes where
- Body: charts, tables,
stat-cardsanddescription-list; problems with the resource go in anAlertthere, not in the card colors. - `CardFooter`: actions.
PanelCard's i18n.labels reaches every built-in text.
Installation
CLI
Manual
- 1
Register the @fma-ds namespace in components.json (once)
- 2
Add the item
Files land in
components/fma-ds/panel-card/panel-card.tsx; npm and registry dependencies are installed along with them.
Dependencies
- npm
- cn@^0.5.0lucide-react@^1.61.0react-aria-components@^1.22.1