Card with a single-series line chart of average session minutes by month, each point labelled with its value, and a footer note on the trend. Client component on recharts 3.8.
"use client"
import { CartesianGrid, LabelList, Line, LineChart, XAxis } from "recharts"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import {
ChartContainer,
ChartTooltip,
ChartTooltipContent,
type ChartConfig,
} from "@/components/ui/chart"
// The copy: change text here, not in the markup.
const COPY = {
title: "Average session",
description: "Minutes per session, May to October 2026",
note: "Sessions run longer since offline albums shipped in August.",
} as const
const AVERAGE_SESSION = [
{ month: "May", minutes: 21 },
{ month: "June", minutes: 24 },
{ month: "July", minutes: 23 },
{ month: "August", minutes: 29 },
{ month: "September", minutes: 33 },
{ month: "October", minutes: 35 },
]
const CHART_CONFIG = {
minutes: { label: "Minutes", color: "var(--chart-2)" },
} satisfies ChartConfig
export default function LineChart01() {
return (
<Card className="mx-auto w-full max-w-md">
<CardHeader>
<CardTitle>
<h2>{COPY.title}</h2>
</CardTitle>
<CardDescription>{COPY.description}</CardDescription>
</CardHeader>
<CardContent>
<ChartContainer config={CHART_CONFIG}>
<LineChart
accessibilityLayer
data={AVERAGE_SESSION}
margin={{ top: 24, left: 16, right: 16 }}
>
<CartesianGrid vertical={false} />
{/* Stock ChartContainer's label color misses recharts 3's label layer. */}
<XAxis
tick={{ fill: "var(--muted-foreground)" }}
dataKey="month"
tickLine={false}
axisLine={false}
tickMargin={8}
tickFormatter={(value: string) => value.slice(0, 3)}
/>
<ChartTooltip
cursor={false}
content={<ChartTooltipContent indicator="line" />}
/>
<Line
dataKey="minutes"
type="natural"
stroke="var(--color-minutes)"
strokeWidth={2}
dot={{ fill: "var(--color-minutes)" }}
activeDot={{ r: 6 }}
>
<LabelList
position="top"
offset={12}
className="fill-foreground"
fontSize={12}
/>
</Line>
</LineChart>
</ChartContainer>
</CardContent>
<CardFooter className="text-sm text-muted-foreground">
<p>{COPY.note}</p>
</CardFooter>
</Card>
)
}
pnpm dlx shadcn add @01orbital/line-chart-01npx shadcn add @01orbital/line-chart-01yarn shadcn add @01orbital/line-chart-01bunx --bun shadcn add @01orbital/line-chart-01Free under the MIT license. Add the @01orbital registry to components.json once (install guide), then run the command.
It lands at components/blocks/charts/line-chart-01/index.tsx, as source you own and edit.
import LineChart01 from "@/components/blocks/charts/line-chart-01"
export default function Example() {
return <LineChart01 />
}npm: recharts@3.8.0. The CLI installs them for you.
Registry pieces it installs with it:
cardchartHorizontal Ranking Bar Chart
Card with a horizontal bar chart ranking five countries by listeners, country names on the axis and values printed at the end of each bar. Client component on recharts 3.8.
Listeners Area Chart Card
Card with a two-series area chart of daily listeners, desktop solid and mobile dashed, a select for 90, 30 or 7 days and a legend that draws the dash. Client component on recharts 3.8.