Chart
ApexCharts wrapper themed from design tokens; loaded on demand.
Installation
bun add @xerobi/ui
import { Chart, ChartLegends, ChartLoading, ChartSelect } from "@xerobi/ui/chart"This component is client-side. In Astro, hydrate it with a client directive.
API reference
Chart
| Prop | Type | Description |
|---|---|---|
| slotProps | { loading?: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> | undefined; } |
ChartLegends
| Prop | Type | Description |
|---|---|---|
| labels | string[] | |
| colors | string[] | |
| values | string[] | |
| sublabels | string[] | |
| icons | ReactNode[] | |
| slotProps | { wrapper?: DetailedHTMLProps<LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> | undefined; root?: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivEl... |
ChartLoading
No props of its own.
ChartSelect
| Prop | Type | Description |
|---|---|---|
| options* | string[] | |
| value* | string | |
| onChange* | (newValue: string) => void |
Hooks
useChart: Default ApexCharts options matching the Minimal look, merged with `updatedOptions`. Colours follow the active brand and light/dark mode.