Chart

Chart frame with optional title, description, toolbar, loading and empty states, plus legend and tooltip helpers.

Also known as: chart frame, plot, data chart, legend

Installation

Install with the CLI, or copy the component source into your project.

Add chart (npm)

npx --yes -p github:itsvigneshv/default-file-ui#main df-ui add chart

Properties

Chart frame, legend, and tooltip helpers for kit plots. Compose ChartFrame around the graphic, then ChartLegend and ChartTooltip as needed.

ChartFrame

PropTypeDefaultNotes
titleReactNode-Header title above the plot.
descriptionReactNode-Supporting copy under the title. Wired as aria-describedby on the plot when the plot has a name.
toolbarReactNode-Actions aligned with the header.
plotLabelstring-Accessible name for the plot. Prefer a short summary of the data. When omitted, a string title is used. Provide plotLabel or a string title so the graphic is not unnamed.
size"sm" | "md" | "lg""md"Plot height step.
loadingbooleanfalseShow the loading placeholder instead of children.
emptybooleanfalseShow emptyContent instead of children.
emptyContentReactNode-Content when empty is true.
childrenReactNode-Plot graphic when not loading or empty.
classNamestring-Additional styles on the frame.

ChartLegend

PropTypeDefaultNotes
itemsreadonly ChartLegendItem[]-Legend rows. Each item has id, label, and optional color.
classNamestring-Additional styles on the list.

ChartTooltip

PropTypeDefaultNotes
activeboolean-Whether the tooltip is shown.
labelReactNode-Tooltip heading.
payloadreadonly ChartTooltipPayloadItem[]-Series rows shown in the tooltip body.
formatValue(value, item) => ReactNode-Optional formatter for each payload value.
classNamestring-Additional styles on the tooltip.