Black Friday · Save 40% on Intent UI Design licenses with code UI2026.

Line chart

Loading...

Installation

Add the component with the CLI.

npx shadcn@latest add @intentui/recharts

Composed components

When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.

Manual installation

Install the dependencies, then copy the component source into your project.

npm install recharts react-aria-components

Examples

Stacked

Stack series to compare their contributions to a total.

Loading...

Monotone

Use monotone interpolation to draw a smooth curve between data points.

Loading...

Custom format

Customize the chart’s colors and styles.

Loading...

Custom tooltip

Use a custom tooltip to display labels, units, or icons when users hover over a data point.

Loading...

Custom legend

Use a custom legend to display series labels, icons, or controls.

Loading...

Custom colors

Set series colors in the chart configuration.

Loading...

Controlled

Manage chart state to switch datasets or coordinate with other controls.

Loading...

Component API

LineChart

LineChart extends the internal Intent UI <BaseChart> component.

cartesianGridPropsCartesianGridProps
chartPropsOmit<React.ComponentProps<typeof LineChartPrimitive>, "data" | "stackOffset">
childrenReact.ReactNode
classNamestring
colorsreadonly (ChartColorKeys | string)[]
Default: DEFAULT_COLORS
configChartConfig
connectNullsboolean
Default: false
containerHeightnumber
Default: 370 desktop / 200 mobile
dataRecord<string, any>[]
Default: []
dataKeystring
displayEdgeLabelsOnlyboolean
Default: false
hideGridLinesboolean
Default: false
hideXAxisboolean
Default: false
hideYAxisboolean
Default: false
intervalTypeIntervalType
Default: equidistantPreserveStart
layoutChartLayout
Default: horizontal
legendLegendContentType | boolean
Default: true
legendPropsOmit<ComponentProps<typeof LegendPrimitive>, "content" | "ref">
linePropsLineProps
tooltipTooltipContentType<ValueType, NameType> | boolean
Default: true
tooltipPropsBaseChartProps["tooltipProps"]
typeChartType
Default: default
valueFormatter(value: number) => string
Default: (value) => value.toString()
xAxisPropsXAxisPropsPrimitive
yAxisPropsYAxisPrimitiveProps

See the Recharts LineChart API reference for the full API reference.

Design