Charts
Composable chart components for data visualization using Recharts
npx shadcn@latest add @roiui/chartnpx shadcn@latest add @roiui/chart-tailwindThe main container component for all charts. Provides configuration and responsive sizing.
Component props
Prop
Type
Default
Name
configDescription
Configuration object that defines chart colors, labels, and icons for data keys
Type
ChartConfigDefault
-
Name
childrenDescription
The Recharts component (LineChart, BarChart, etc.) to render inside the container
Type
ReactNodeDefault
-
Name
idDescription
Optional unique identifier for the chart. Auto-generated if not provided
Type
stringDefault
-
Name
classNameDescription
Additional CSS classes to apply to the chart container
Type
stringDefault
-
Custom tooltip content component for displaying data on hover.
Component props
Prop
Type
Default
Name
indicatorDescription
The visual style of the indicator shown next to each tooltip item
Type
"line" | "dot" | "dashed"Default
"dot"Name
hideLabelDescription
Whether to hide the tooltip label (typically the x-axis value)
Type
booleanDefault
falseName
hideIndicatorDescription
Whether to hide the color indicator for each data series
Type
booleanDefault
falseName
labelFormatterDescription
Function to format the tooltip label. Receives (value, payload) and returns ReactNode
Type
functionDefault
-
Name
formatterDescription
Function to format individual tooltip values. Receives (value, name, item, index, payload)
Type
functionDefault
-
Name
labelClassNameDescription
Additional CSS classes to apply to the tooltip label
Type
stringDefault
-
Name
classNameDescription
Additional CSS classes to apply to the tooltip container
Type
stringDefault
-
Name
colorDescription
Override color for all tooltip indicators
Type
stringDefault
-
Name
nameKeyDescription
Key to use for looking up item names in the config
Type
stringDefault
-
Name
labelKeyDescription
Key to use for looking up the label value from the payload
Type
stringDefault
-
Custom legend component for displaying chart data series.
Component props
Prop
Type
Default
Name
hideIconDescription
Whether to hide custom icons defined in the chart config
Type
booleanDefault
falseName
verticalAlignDescription
Vertical alignment of the legend
Type
"top" | "bottom"Default
"bottom"Name
nameKeyDescription
Key to use for looking up item names in the config
Type
stringDefault
-
Name
classNameDescription
Additional CSS classes to apply to the legend container
Type
stringDefault
-
For individual chart components (LineChart, BarChart, AreaChart, PieChart, etc.), refer to the Recharts API documentation.