Area Chart

A customizable area chart component to visualize your data with gradient fills and smooth curves. 📈



Installation

pnpm dlx shadcn@latest add 'https://retroui.dev/r/area-chart.json'


Examples

Default



Multiple Categories



Stacked Areas



API Reference

PropTypeDefaultDescription
dataRecord<string, any>[][]Array of data objects to display
indexstring-Key for the x-axis (category) data
categoriesstring[][]Array of keys for the data values to display as areas
fill"gradient" | "solid""gradient"Fill style for the areas
strokeColorsstring[]["var(--foreground)"]Array of stroke colors for the areas
fillColorsstring[]["var(--primary)"]Array of fill colors for the areas
tooltipBgColorstring"var(--background)"Background color for tooltips
tooltipBorderColorstring"var(--border)"Border color for tooltips
gridColorstring"var(--muted)"Color for the grid lines
valueFormatter(value: number) => string(value) => value.toString()Function to format values
showGridbooleantrueWhether to show grid lines
showTooltipbooleantrueWhether to show tooltips on hover
classNamestring-Additional CSS classes

Last Updated: 12 Aug, 2025