Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

[Design System] feat: Added Chart component (#27839)

Jonathan Summers-Muir40770afd4376
diff --git a/apps/design-system/__registry__/default/block/chart-area-axes.tsx b/apps/design-system/__registry__/default/block/chart-area-axes.tsx
new file mode 100644
index 00000000000..26713267cbd
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-area-axes.tsx
@@ -0,0 +1,91 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis, YAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'An area chart with axes'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Axes</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: -20,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <YAxis tickLine={false} axisLine={false} tickMargin={8} tickCount={3} />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
+ <Area
+ dataKey="mobile"
+ type="natural"
+ fill="var(--color-mobile)"
+ fillOpacity={0.4}
+ stroke="var(--color-mobile)"
+ stackId="a"
+ />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ stackId="a"
+ />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-area-default.tsx b/apps/design-system/__registry__/default/block/chart-area-default.tsx
new file mode 100644
index 00000000000..0ccfe016d7c
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-area-default.tsx
@@ -0,0 +1,77 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A simple area chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-area-gradient.tsx b/apps/design-system/__registry__/default/block/chart-area-gradient.tsx
new file mode 100644
index 00000000000..d6e7ad9b621
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-area-gradient.tsx
@@ -0,0 +1,100 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'An area chart with gradient fill'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Gradient</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
+ <defs>
+ <linearGradient id="fillDesktop" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor="var(--color-desktop)" stopOpacity={0.8} />
+ <stop offset="95%" stopColor="var(--color-desktop)" stopOpacity={0.1} />
+ </linearGradient>
+ <linearGradient id="fillMobile" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor="var(--color-mobile)" stopOpacity={0.8} />
+ <stop offset="95%" stopColor="var(--color-mobile)" stopOpacity={0.1} />
+ </linearGradient>
+ </defs>
+ <Area
+ dataKey="mobile"
+ type="natural"
+ fill="url(#fillMobile)"
+ fillOpacity={0.4}
+ stroke="var(--color-mobile)"
+ stackId="a"
+ />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="url(#fillDesktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ stackId="a"
+ />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-area-icons.tsx b/apps/design-system/__registry__/default/block/chart-area-icons.tsx
new file mode 100644
index 00000000000..bc9d0195253
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-area-icons.tsx
@@ -0,0 +1,100 @@
+'use client'
+
+import { TrendingDown, TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import {
+ ChartConfig,
+ ChartContainer,
+ ChartLegend,
+ ChartLegendContent,
+ ChartTooltip,
+ ChartTooltipContent,
+} from 'ui'
+
+export const description = 'An area chart with icons'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ icon: TrendingDown,
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ icon: TrendingUp,
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Icons</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <Area
+ dataKey="mobile"
+ type="natural"
+ fill="var(--color-mobile)"
+ fillOpacity={0.4}
+ stroke="var(--color-mobile)"
+ stackId="a"
+ />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ stackId="a"
+ />
+ <ChartLegend content={<ChartLegendContent />} />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-area-interactive.tsx b/apps/design-system/__registry__/default/block/chart-area-interactive.tsx
new file mode 100644
index 00000000000..df2579fe8f8
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-area-interactive.tsx
@@ -0,0 +1,238 @@
+'use client'
+
+import * as React from 'react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
+import {
+ ChartConfig,
+ ChartContainer,
+ ChartLegend,
+ ChartLegendContent,
+ ChartTooltip,
+ ChartTooltipContent,
+} from 'ui'
+import {
+ Select_Shadcn_,
+ SelectContent_Shadcn_,
+ SelectItem_Shadcn_,
+ SelectTrigger_Shadcn_,
+ SelectValue_Shadcn_,
+} from 'ui'
+
+export const description = 'An interactive area chart'
+
+const chartData = [
+ { date: '2024-04-01', desktop: 222, mobile: 150 },
+ { date: '2024-04-02', desktop: 97, mobile: 180 },
+ { date: '2024-04-03', desktop: 167, mobile: 120 },
+ { date: '2024-04-04', desktop: 242, mobile: 260 },
+ { date: '2024-04-05', desktop: 373, mobile: 290 },
+ { date: '2024-04-06', desktop: 301, mobile: 340 },
+ { date: '2024-04-07', desktop: 245, mobile: 180 },
+ { date: '2024-04-08', desktop: 409, mobile: 320 },
+ { date: '2024-04-09', desktop: 59, mobile: 110 },
+ { date: '2024-04-10', desktop: 261, mobile: 190 },
+ { date: '2024-04-11', desktop: 327, mobile: 350 },
+ { date: '2024-04-12', desktop: 292, mobile: 210 },
+ { date: '2024-04-13', desktop: 342, mobile: 380 },
+ { date: '2024-04-14', desktop: 137, mobile: 220 },
+ { date: '2024-04-15', desktop: 120, mobile: 170 },
+ { date: '2024-04-16', desktop: 138, mobile: 190 },
+ { date: '2024-04-17', desktop: 446, mobile: 360 },
+ { date: '2024-04-18', desktop: 364, mobile: 410 },
+ { date: '2024-04-19', desktop: 243, mobile: 180 },
+ { date: '2024-04-20', desktop: 89, mobile: 150 },
+ { date: '2024-04-21', desktop: 137, mobile: 200 },
+ { date: '2024-04-22', desktop: 224, mobile: 170 },
+ { date: '2024-04-23', desktop: 138, mobile: 230 },
+ { date: '2024-04-24', desktop: 387, mobile: 290 },
+ { date: '2024-04-25', desktop: 215, mobile: 250 },
+ { date: '2024-04-26', desktop: 75, mobile: 130 },
+ { date: '2024-04-27', desktop: 383, mobile: 420 },
+ { date: '2024-04-28', desktop: 122, mobile: 180 },
+ { date: '2024-04-29', desktop: 315, mobile: 240 },
+ { date: '2024-04-30', desktop: 454, mobile: 380 },
+ { date: '2024-05-01', desktop: 165, mobile: 220 },
+ { date: '2024-05-02', desktop: 293, mobile: 310 },
+ { date: '2024-05-03', desktop: 247, mobile: 190 },
+ { date: '2024-05-04', desktop: 385, mobile: 420 },
+ { date: '2024-05-05', desktop: 481, mobile: 390 },
+ { date: '2024-05-06', desktop: 498, mobile: 520 },
+ { date: '2024-05-07', desktop: 388, mobile: 300 },
+ { date: '2024-05-08', desktop: 149, mobile: 210 },
+ { date: '2024-05-09', desktop: 227, mobile: 180 },
+ { date: '2024-05-10', desktop: 293, mobile: 330 },
+ { date: '2024-05-11', desktop: 335, mobile: 270 },
+ { date: '2024-05-12', desktop: 197, mobile: 240 },
+ { date: '2024-05-13', desktop: 197, mobile: 160 },
+ { date: '2024-05-14', desktop: 448, mobile: 490 },
+ { date: '2024-05-15', desktop: 473, mobile: 380 },
+ { date: '2024-05-16', desktop: 338, mobile: 400 },
+ { date: '2024-05-17', desktop: 499, mobile: 420 },
+ { date: '2024-05-18', desktop: 315, mobile: 350 },
+ { date: '2024-05-19', desktop: 235, mobile: 180 },
+ { date: '2024-05-20', desktop: 177, mobile: 230 },
+ { date: '2024-05-21', desktop: 82, mobile: 140 },
+ { date: '2024-05-22', desktop: 81, mobile: 120 },
+ { date: '2024-05-23', desktop: 252, mobile: 290 },
+ { date: '2024-05-24', desktop: 294, mobile: 220 },
+ { date: '2024-05-25', desktop: 201, mobile: 250 },
+ { date: '2024-05-26', desktop: 213, mobile: 170 },
+ { date: '2024-05-27', desktop: 420, mobile: 460 },
+ { date: '2024-05-28', desktop: 233, mobile: 190 },
+ { date: '2024-05-29', desktop: 78, mobile: 130 },
+ { date: '2024-05-30', desktop: 340, mobile: 280 },
+ { date: '2024-05-31', desktop: 178, mobile: 230 },
+ { date: '2024-06-01', desktop: 178, mobile: 200 },
+ { date: '2024-06-02', desktop: 470, mobile: 410 },
+ { date: '2024-06-03', desktop: 103, mobile: 160 },
+ { date: '2024-06-04', desktop: 439, mobile: 380 },
+ { date: '2024-06-05', desktop: 88, mobile: 140 },
+ { date: '2024-06-06', desktop: 294, mobile: 250 },
+ { date: '2024-06-07', desktop: 323, mobile: 370 },
+ { date: '2024-06-08', desktop: 385, mobile: 320 },
+ { date: '2024-06-09', desktop: 438, mobile: 480 },
+ { date: '2024-06-10', desktop: 155, mobile: 200 },
+ { date: '2024-06-11', desktop: 92, mobile: 150 },
+ { date: '2024-06-12', desktop: 492, mobile: 420 },
+ { date: '2024-06-13', desktop: 81, mobile: 130 },
+ { date: '2024-06-14', desktop: 426, mobile: 380 },
+ { date: '2024-06-15', desktop: 307, mobile: 350 },
+ { date: '2024-06-16', desktop: 371, mobile: 310 },
+ { date: '2024-06-17', desktop: 475, mobile: 520 },
+ { date: '2024-06-18', desktop: 107, mobile: 170 },
+ { date: '2024-06-19', desktop: 341, mobile: 290 },
+ { date: '2024-06-20', desktop: 408, mobile: 450 },
+ { date: '2024-06-21', desktop: 169, mobile: 210 },
+ { date: '2024-06-22', desktop: 317, mobile: 270 },
+ { date: '2024-06-23', desktop: 480, mobile: 530 },
+ { date: '2024-06-24', desktop: 132, mobile: 180 },
+ { date: '2024-06-25', desktop: 141, mobile: 190 },
+ { date: '2024-06-26', desktop: 434, mobile: 380 },
+ { date: '2024-06-27', desktop: 448, mobile: 490 },
+ { date: '2024-06-28', desktop: 149, mobile: 200 },
+ { date: '2024-06-29', desktop: 103, mobile: 160 },
+ { date: '2024-06-30', desktop: 446, mobile: 400 },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ const [timeRange, setTimeRange] = React.useState('90d')
+
+ const filteredData = chartData.filter((item) => {
+ const date = new Date(item.date)
+ const now = new Date()
+ let daysToSubtract = 90
+ if (timeRange === '30d') {
+ daysToSubtract = 30
+ } else if (timeRange === '7d') {
+ daysToSubtract = 7
+ }
+ now.setDate(now.getDate() - daysToSubtract)
+ return date >= now
+ })
+
+ return (
+ <Card>
+ <CardHeader className="flex items-center gap-2 space-y-0 border-b py-5 sm:flex-row">
+ <div className="grid flex-1 gap-1 text-center sm:text-left">
+ <CardTitle>Area Chart - Interactive</CardTitle>
+ <CardDescription>Showing total visitors for the last 3 months</CardDescription>
+ </div>
+ <Select_Shadcn_ value={timeRange} onValueChange={setTimeRange}>
+ <SelectTrigger_Shadcn_
+ className="w-[160px] rounded-lg sm:ml-auto"
+ aria-label="Select a value"
+ >
+ <SelectValue_Shadcn_ placeholder="Last 3 months" />
+ </SelectTrigger_Shadcn_>
+ <SelectContent_Shadcn_ className="rounded-xl">
+ <SelectItem_Shadcn_ value="90d" className="rounded-lg">
+ Last 3 months
+ </SelectItem_Shadcn_>
+ <SelectItem_Shadcn_ value="30d" className="rounded-lg">
+ Last 30 days
+ </SelectItem_Shadcn_>
+ <SelectItem_Shadcn_ value="7d" className="rounded-lg">
+ Last 7 days
+ </SelectItem_Shadcn_>
+ </SelectContent_Shadcn_>
+ </Select_Shadcn_>
+ </CardHeader>
+ <CardContent className="px-2 pt-4 sm:px-6 sm:pt-6">
+ <ChartContainer config={chartConfig} className="aspect-auto h-[250px] w-full">
+ <AreaChart data={filteredData}>
+ <defs>
+ <linearGradient id="fillDesktop" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor="var(--color-desktop)" stopOpacity={0.8} />
+ <stop offset="95%" stopColor="var(--color-desktop)" stopOpacity={0.1} />
+ </linearGradient>
+ <linearGradient id="fillMobile" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor="var(--color-mobile)" stopOpacity={0.8} />
+ <stop offset="95%" stopColor="var(--color-mobile)" stopOpacity={0.1} />
+ </linearGradient>
+ </defs>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="date"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ minTickGap={32}
+ tickFormatter={(value) => {
+ const date = new Date(value)
+ return date.toLocaleDateString('en-US', {
+ month: 'short',
+ day: 'numeric',
+ })
+ }}
+ />
+ <ChartTooltip
+ cursor={false}
+ content={
+ <ChartTooltipContent
+ labelFormatter={(value) => {
+ return new Date(value).toLocaleDateString('en-US', {
+ month: 'short',
+ day: 'numeric',
+ })
+ }}
+ indicator="dot"
+ />
+ }
+ />
+ <Area
+ dataKey="mobile"
+ type="natural"
+ fill="url(#fillMobile)"
+ stroke="var(--color-mobile)"
+ stackId="a"
+ />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="url(#fillDesktop)"
+ stroke="var(--color-desktop)"
+ stackId="a"
+ />
+ <ChartLegend content={<ChartLegendContent />} />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-area-legend.tsx b/apps/design-system/__registry__/default/block/chart-area-legend.tsx
new file mode 100644
index 00000000000..a58cfa9fbd9
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-area-legend.tsx
@@ -0,0 +1,98 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import {
+ ChartConfig,
+ ChartContainer,
+ ChartLegend,
+ ChartLegendContent,
+ ChartTooltip,
+ ChartTooltipContent,
+} from 'ui'
+
+export const description = 'An area chart with a legend'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Legend</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <Area
+ dataKey="mobile"
+ type="natural"
+ fill="var(--color-mobile)"
+ fillOpacity={0.4}
+ stroke="var(--color-mobile)"
+ stackId="a"
+ />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ stackId="a"
+ />
+ <ChartLegend content={<ChartLegendContent />} />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-area-linear.tsx b/apps/design-system/__registry__/default/block/chart-area-linear.tsx
new file mode 100644
index 00000000000..8381711c7aa
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-area-linear.tsx
@@ -0,0 +1,80 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A linear area chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Linear</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent indicator="dot" hideLabel />}
+ />
+ <Area
+ dataKey="desktop"
+ type="linear"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-area-stacked-expand.tsx b/apps/design-system/__registry__/default/block/chart-area-stacked-expand.tsx
new file mode 100644
index 00000000000..eca0b1118f7
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-area-stacked-expand.tsx
@@ -0,0 +1,104 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A stacked area chart with expand stacking'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80, other: 45 },
+ { month: 'February', desktop: 305, mobile: 200, other: 100 },
+ { month: 'March', desktop: 237, mobile: 120, other: 150 },
+ { month: 'April', desktop: 73, mobile: 190, other: 50 },
+ { month: 'May', desktop: 209, mobile: 130, other: 100 },
+ { month: 'June', desktop: 214, mobile: 140, other: 160 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-3))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Stacked Expanded</CardTitle>
+ <CardDescription>Showing total visitors for the last 6months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ top: 12,
+ }}
+ stackOffset="expand"
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <Area
+ dataKey="other"
+ type="natural"
+ fill="var(--color-other)"
+ fillOpacity={0.1}
+ stroke="var(--color-other)"
+ stackId="a"
+ />
+ <Area
+ dataKey="mobile"
+ type="natural"
+ fill="var(--color-mobile)"
+ fillOpacity={0.4}
+ stroke="var(--color-mobile)"
+ stackId="a"
+ />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ stackId="a"
+ />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-area-stacked.tsx b/apps/design-system/__registry__/default/block/chart-area-stacked.tsx
new file mode 100644
index 00000000000..22c0f58558b
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-area-stacked.tsx
@@ -0,0 +1,90 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A stacked area chart'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Stacked</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="dot" />} />
+ <Area
+ dataKey="mobile"
+ type="natural"
+ fill="var(--color-mobile)"
+ fillOpacity={0.4}
+ stroke="var(--color-mobile)"
+ stackId="a"
+ />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ stackId="a"
+ />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-area-step.tsx b/apps/design-system/__registry__/default/block/chart-area-step.tsx
new file mode 100644
index 00000000000..5ac732aeaf4
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-area-step.tsx
@@ -0,0 +1,78 @@
+'use client'
+
+import { Activity, TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A step area chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ icon: Activity,
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Step</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Area
+ dataKey="desktop"
+ type="step"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-active.tsx b/apps/design-system/__registry__/default/block/chart-bar-active.tsx
new file mode 100644
index 00000000000..b1ab1d95e1a
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-bar-active.tsx
@@ -0,0 +1,94 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, CartesianGrid, Rectangle, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A bar chart with an active bar'
+
+const chartData = [
+ { browser: 'chrome', visitors: 187, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 275, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Active</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="browser"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => chartConfig[value as keyof typeof chartConfig]?.label}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Bar
+ dataKey="visitors"
+ strokeWidth={2}
+ radius={8}
+ activeIndex={2}
+ activeBar={({ ...props }) => {
+ return (
+ <Rectangle
+ {...props}
+ fillOpacity={0.8}
+ stroke={props.payload.fill}
+ strokeDasharray={4}
+ strokeDashoffset={4}
+ />
+ )
+ }}
+ />
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-default.tsx b/apps/design-system/__registry__/default/block/chart-bar-default.tsx
new file mode 100644
index 00000000000..1c0596e3b57
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-bar-default.tsx
@@ -0,0 +1,60 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A bar chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={8} />
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-horizontal.tsx b/apps/design-system/__registry__/default/block/chart-bar-horizontal.tsx
new file mode 100644
index 00000000000..2305d0a4e1c
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-bar-horizontal.tsx
@@ -0,0 +1,68 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, XAxis, YAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A horizontal bar chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Horizontal</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart
+ accessibilityLayer
+ data={chartData}
+ layout="vertical"
+ margin={{
+ left: -20,
+ }}
+ >
+ <XAxis type="number" dataKey="desktop" hide />
+ <YAxis
+ dataKey="month"
+ type="category"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={5} />
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-interactive.tsx b/apps/design-system/__registry__/default/block/chart-bar-interactive.tsx
new file mode 100644
index 00000000000..54cff2219b7
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-bar-interactive.tsx
@@ -0,0 +1,202 @@
+'use client'
+
+import * as React from 'react'
+import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'An interactive bar chart'
+
+const chartData = [
+ { date: '2024-04-01', desktop: 222, mobile: 150 },
+ { date: '2024-04-02', desktop: 97, mobile: 180 },
+ { date: '2024-04-03', desktop: 167, mobile: 120 },
+ { date: '2024-04-04', desktop: 242, mobile: 260 },
+ { date: '2024-04-05', desktop: 373, mobile: 290 },
+ { date: '2024-04-06', desktop: 301, mobile: 340 },
+ { date: '2024-04-07', desktop: 245, mobile: 180 },
+ { date: '2024-04-08', desktop: 409, mobile: 320 },
+ { date: '2024-04-09', desktop: 59, mobile: 110 },
+ { date: '2024-04-10', desktop: 261, mobile: 190 },
+ { date: '2024-04-11', desktop: 327, mobile: 350 },
+ { date: '2024-04-12', desktop: 292, mobile: 210 },
+ { date: '2024-04-13', desktop: 342, mobile: 380 },
+ { date: '2024-04-14', desktop: 137, mobile: 220 },
+ { date: '2024-04-15', desktop: 120, mobile: 170 },
+ { date: '2024-04-16', desktop: 138, mobile: 190 },
+ { date: '2024-04-17', desktop: 446, mobile: 360 },
+ { date: '2024-04-18', desktop: 364, mobile: 410 },
+ { date: '2024-04-19', desktop: 243, mobile: 180 },
+ { date: '2024-04-20', desktop: 89, mobile: 150 },
+ { date: '2024-04-21', desktop: 137, mobile: 200 },
+ { date: '2024-04-22', desktop: 224, mobile: 170 },
+ { date: '2024-04-23', desktop: 138, mobile: 230 },
+ { date: '2024-04-24', desktop: 387, mobile: 290 },
+ { date: '2024-04-25', desktop: 215, mobile: 250 },
+ { date: '2024-04-26', desktop: 75, mobile: 130 },
+ { date: '2024-04-27', desktop: 383, mobile: 420 },
+ { date: '2024-04-28', desktop: 122, mobile: 180 },
+ { date: '2024-04-29', desktop: 315, mobile: 240 },
+ { date: '2024-04-30', desktop: 454, mobile: 380 },
+ { date: '2024-05-01', desktop: 165, mobile: 220 },
+ { date: '2024-05-02', desktop: 293, mobile: 310 },
+ { date: '2024-05-03', desktop: 247, mobile: 190 },
+ { date: '2024-05-04', desktop: 385, mobile: 420 },
+ { date: '2024-05-05', desktop: 481, mobile: 390 },
+ { date: '2024-05-06', desktop: 498, mobile: 520 },
+ { date: '2024-05-07', desktop: 388, mobile: 300 },
+ { date: '2024-05-08', desktop: 149, mobile: 210 },
+ { date: '2024-05-09', desktop: 227, mobile: 180 },
+ { date: '2024-05-10', desktop: 293, mobile: 330 },
+ { date: '2024-05-11', desktop: 335, mobile: 270 },
+ { date: '2024-05-12', desktop: 197, mobile: 240 },
+ { date: '2024-05-13', desktop: 197, mobile: 160 },
+ { date: '2024-05-14', desktop: 448, mobile: 490 },
+ { date: '2024-05-15', desktop: 473, mobile: 380 },
+ { date: '2024-05-16', desktop: 338, mobile: 400 },
+ { date: '2024-05-17', desktop: 499, mobile: 420 },
+ { date: '2024-05-18', desktop: 315, mobile: 350 },
+ { date: '2024-05-19', desktop: 235, mobile: 180 },
+ { date: '2024-05-20', desktop: 177, mobile: 230 },
+ { date: '2024-05-21', desktop: 82, mobile: 140 },
+ { date: '2024-05-22', desktop: 81, mobile: 120 },
+ { date: '2024-05-23', desktop: 252, mobile: 290 },
+ { date: '2024-05-24', desktop: 294, mobile: 220 },
+ { date: '2024-05-25', desktop: 201, mobile: 250 },
+ { date: '2024-05-26', desktop: 213, mobile: 170 },
+ { date: '2024-05-27', desktop: 420, mobile: 460 },
+ { date: '2024-05-28', desktop: 233, mobile: 190 },
+ { date: '2024-05-29', desktop: 78, mobile: 130 },
+ { date: '2024-05-30', desktop: 340, mobile: 280 },
+ { date: '2024-05-31', desktop: 178, mobile: 230 },
+ { date: '2024-06-01', desktop: 178, mobile: 200 },
+ { date: '2024-06-02', desktop: 470, mobile: 410 },
+ { date: '2024-06-03', desktop: 103, mobile: 160 },
+ { date: '2024-06-04', desktop: 439, mobile: 380 },
+ { date: '2024-06-05', desktop: 88, mobile: 140 },
+ { date: '2024-06-06', desktop: 294, mobile: 250 },
+ { date: '2024-06-07', desktop: 323, mobile: 370 },
+ { date: '2024-06-08', desktop: 385, mobile: 320 },
+ { date: '2024-06-09', desktop: 438, mobile: 480 },
+ { date: '2024-06-10', desktop: 155, mobile: 200 },
+ { date: '2024-06-11', desktop: 92, mobile: 150 },
+ { date: '2024-06-12', desktop: 492, mobile: 420 },
+ { date: '2024-06-13', desktop: 81, mobile: 130 },
+ { date: '2024-06-14', desktop: 426, mobile: 380 },
+ { date: '2024-06-15', desktop: 307, mobile: 350 },
+ { date: '2024-06-16', desktop: 371, mobile: 310 },
+ { date: '2024-06-17', desktop: 475, mobile: 520 },
+ { date: '2024-06-18', desktop: 107, mobile: 170 },
+ { date: '2024-06-19', desktop: 341, mobile: 290 },
+ { date: '2024-06-20', desktop: 408, mobile: 450 },
+ { date: '2024-06-21', desktop: 169, mobile: 210 },
+ { date: '2024-06-22', desktop: 317, mobile: 270 },
+ { date: '2024-06-23', desktop: 480, mobile: 530 },
+ { date: '2024-06-24', desktop: 132, mobile: 180 },
+ { date: '2024-06-25', desktop: 141, mobile: 190 },
+ { date: '2024-06-26', desktop: 434, mobile: 380 },
+ { date: '2024-06-27', desktop: 448, mobile: 490 },
+ { date: '2024-06-28', desktop: 149, mobile: 200 },
+ { date: '2024-06-29', desktop: 103, mobile: 160 },
+ { date: '2024-06-30', desktop: 446, mobile: 400 },
+]
+
+const chartConfig = {
+ views: {
+ label: 'Page Views',
+ },
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ const [activeChart, setActiveChart] = React.useState<keyof typeof chartConfig>('desktop')
+
+ const total = React.useMemo(
+ () => ({
+ desktop: chartData.reduce((acc, curr) => acc + curr.desktop, 0),
+ mobile: chartData.reduce((acc, curr) => acc + curr.mobile, 0),
+ }),
+ []
+ )
+
+ return (
+ <Card>
+ <CardHeader className="flex flex-col items-stretch space-y-0 border-b p-0 sm:flex-row">
+ <div className="flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6">
+ <CardTitle>Bar Chart - Interactive</CardTitle>
+ <CardDescription>Showing total visitors for the last 3 months</CardDescription>
+ </div>
+ <div className="flex">
+ {['desktop', 'mobile'].map((key) => {
+ const chart = key as keyof typeof chartConfig
+ return (
+ <button
+ key={chart}
+ data-active={activeChart === chart}
+ className="relative z-30 flex flex-1 flex-col justify-center gap-1 border-t px-6 py-4 text-left even:border-l data-[active=true]:bg-muted/50 sm:border-l sm:border-t-0 sm:px-8 sm:py-6"
+ onClick={() => setActiveChart(chart)}
+ >
+ <span className="text-xs text-muted-foreground">{chartConfig[chart].label}</span>
+ <span className="text-lg font-bold leading-none sm:text-3xl">
+ {total[key as keyof typeof total].toLocaleString()}
+ </span>
+ </button>
+ )
+ })}
+ </div>
+ </CardHeader>
+ <CardContent className="px-2 sm:p-6">
+ <ChartContainer config={chartConfig} className="aspect-auto h-[250px] w-full">
+ <BarChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="date"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ minTickGap={32}
+ tickFormatter={(value) => {
+ const date = new Date(value)
+ return date.toLocaleDateString('en-US', {
+ month: 'short',
+ day: 'numeric',
+ })
+ }}
+ />
+ <ChartTooltip
+ content={
+ <ChartTooltipContent
+ className="w-[150px]"
+ nameKey="views"
+ labelFormatter={(value) => {
+ return new Date(value).toLocaleDateString('en-US', {
+ month: 'short',
+ day: 'numeric',
+ year: 'numeric',
+ })
+ }}
+ />
+ }
+ />
+ <Bar dataKey={activeChart} fill={`var(--color-${activeChart})`} />
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-label-custom.tsx b/apps/design-system/__registry__/default/block/chart-bar-label-custom.tsx
new file mode 100644
index 00000000000..7867342bc6d
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-bar-label-custom.tsx
@@ -0,0 +1,92 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, CartesianGrid, LabelList, XAxis, YAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A bar chart with a custom label'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+ label: {
+ color: 'hsl(var(--background))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Custom Label</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart
+ accessibilityLayer
+ data={chartData}
+ layout="vertical"
+ margin={{
+ right: 16,
+ }}
+ >
+ <CartesianGrid horizontal={false} />
+ <YAxis
+ dataKey="month"
+ type="category"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ hide
+ />
+ <XAxis dataKey="desktop" type="number" hide />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <Bar dataKey="desktop" layout="vertical" fill="var(--color-desktop)" radius={4}>
+ <LabelList
+ dataKey="month"
+ position="insideLeft"
+ offset={8}
+ className="fill-[--color-label]"
+ fontSize={12}
+ />
+ <LabelList
+ dataKey="desktop"
+ position="right"
+ offset={8}
+ className="fill-foreground"
+ fontSize={12}
+ />
+ </Bar>
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-label.tsx b/apps/design-system/__registry__/default/block/chart-bar-label.tsx
new file mode 100644
index 00000000000..3bbdcc7a7ea
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-bar-label.tsx
@@ -0,0 +1,68 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, CartesianGrid, LabelList, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A bar chart with a label'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Label</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ top: 20,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={8}>
+ <LabelList position="top" offset={12} className="fill-foreground" fontSize={12} />
+ </Bar>
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-mixed.tsx b/apps/design-system/__registry__/default/block/chart-bar-mixed.tsx
new file mode 100644
index 00000000000..1790507f73f
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-bar-mixed.tsx
@@ -0,0 +1,86 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, XAxis, YAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A mixed bar chart'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Mixed</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart
+ accessibilityLayer
+ data={chartData}
+ layout="vertical"
+ margin={{
+ left: 0,
+ }}
+ >
+ <YAxis
+ dataKey="browser"
+ type="category"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => chartConfig[value as keyof typeof chartConfig]?.label}
+ />
+ <XAxis dataKey="visitors" type="number" hide />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Bar dataKey="visitors" layout="vertical" radius={5} />
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-multiple.tsx b/apps/design-system/__registry__/default/block/chart-bar-multiple.tsx
new file mode 100644
index 00000000000..ffb9c61679a
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-bar-multiple.tsx
@@ -0,0 +1,65 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A multiple bar chart'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Multiple</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="dashed" />} />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
+ <Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-negative.tsx b/apps/design-system/__registry__/default/block/chart-bar-negative.tsx
new file mode 100644
index 00000000000..43f87ef0762
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-bar-negative.tsx
@@ -0,0 +1,63 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, CartesianGrid, Cell, LabelList } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A bar chart with negative values'
+
+const chartData = [
+ { month: 'January', visitors: 186 },
+ { month: 'February', visitors: 205 },
+ { month: 'March', visitors: -207 },
+ { month: 'April', visitors: 173 },
+ { month: 'May', visitors: -209 },
+ { month: 'June', visitors: 214 },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Negative</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent hideLabel hideIndicator />}
+ />
+ <Bar dataKey="visitors">
+ <LabelList position="top" dataKey="month" fillOpacity={1} />
+ {chartData.map((item) => (
+ <Cell
+ key={item.month}
+ fill={item.visitors > 0 ? 'hsl(var(--chart-1))' : 'hsl(var(--chart-2))'}
+ />
+ ))}
+ </Bar>
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-stacked.tsx b/apps/design-system/__registry__/default/block/chart-bar-stacked.tsx
new file mode 100644
index 00000000000..34a7439e982
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-bar-stacked.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import {
+ ChartConfig,
+ ChartContainer,
+ ChartLegend,
+ ChartLegendContent,
+ ChartTooltip,
+ ChartTooltipContent,
+} from 'ui'
+
+export const description = 'A stacked bar chart with a legend'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Stacked + Legend</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip content={<ChartTooltipContent hideLabel />} />
+ <ChartLegend content={<ChartLegendContent />} />
+ <Bar dataKey="desktop" stackId="a" fill="var(--color-desktop)" radius={[0, 0, 4, 4]} />
+ <Bar dataKey="mobile" stackId="a" fill="var(--color-mobile)" radius={[4, 4, 0, 0]} />
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-line-default.tsx b/apps/design-system/__registry__/default/block/chart-line-default.tsx
new file mode 100644
index 00000000000..408dc1d6f9f
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-line-default.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A line chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Line
+ dataKey="desktop"
+ type="natural"
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ dot={false}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-line-dots-colors.tsx b/apps/design-system/__registry__/default/block/chart-line-dots-colors.tsx
new file mode 100644
index 00000000000..c8a55a0c44b
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-line-dots-colors.tsx
@@ -0,0 +1,100 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, Dot, Line, LineChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A line chart with dots and colors'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ color: 'hsl(var(--chart-2))',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Dots Colors</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ top: 24,
+ left: 24,
+ right: 24,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent indicator="line" nameKey="visitors" hideLabel />}
+ />
+ <Line
+ dataKey="visitors"
+ type="natural"
+ stroke="var(--color-visitors)"
+ strokeWidth={2}
+ dot={({ payload, ...props }) => {
+ return (
+ <Dot
+ key={payload.browser}
+ r={5}
+ cx={props.cx}
+ cy={props.cy}
+ fill={payload.fill}
+ stroke={payload.fill}
+ />
+ )
+ }}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-line-dots-custom.tsx b/apps/design-system/__registry__/default/block/chart-line-dots-custom.tsx
new file mode 100644
index 00000000000..87c69309319
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-line-dots-custom.tsx
@@ -0,0 +1,90 @@
+'use client'
+
+import { GitCommitVertical, TrendingUp } from 'lucide-react'
+import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A line chart with custom dots'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Custom Dots</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Line
+ dataKey="desktop"
+ type="natural"
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ dot={({ cx, cy, payload }) => {
+ const r = 24
+ return (
+ <GitCommitVertical
+ key={payload.month}
+ x={cx - r / 2}
+ y={cy - r / 2}
+ width={r}
+ height={r}
+ fill="hsl(var(--background))"
+ stroke="var(--color-desktop)"
+ />
+ )
+ }}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-line-dots.tsx b/apps/design-system/__registry__/default/block/chart-line-dots.tsx
new file mode 100644
index 00000000000..cc211f2c2b4
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-line-dots.tsx
@@ -0,0 +1,82 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A line chart with dots'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Dots</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Line
+ dataKey="desktop"
+ type="natural"
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ dot={{
+ fill: 'var(--color-desktop)',
+ }}
+ activeDot={{
+ r: 6,
+ }}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-line-interactive.tsx b/apps/design-system/__registry__/default/block/chart-line-interactive.tsx
new file mode 100644
index 00000000000..5f9c92b9792
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-line-interactive.tsx
@@ -0,0 +1,208 @@
+'use client'
+
+import * as React from 'react'
+import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'An interactive line chart'
+
+const chartData = [
+ { date: '2024-04-01', desktop: 222, mobile: 150 },
+ { date: '2024-04-02', desktop: 97, mobile: 180 },
+ { date: '2024-04-03', desktop: 167, mobile: 120 },
+ { date: '2024-04-04', desktop: 242, mobile: 260 },
+ { date: '2024-04-05', desktop: 373, mobile: 290 },
+ { date: '2024-04-06', desktop: 301, mobile: 340 },
+ { date: '2024-04-07', desktop: 245, mobile: 180 },
+ { date: '2024-04-08', desktop: 409, mobile: 320 },
+ { date: '2024-04-09', desktop: 59, mobile: 110 },
+ { date: '2024-04-10', desktop: 261, mobile: 190 },
+ { date: '2024-04-11', desktop: 327, mobile: 350 },
+ { date: '2024-04-12', desktop: 292, mobile: 210 },
+ { date: '2024-04-13', desktop: 342, mobile: 380 },
+ { date: '2024-04-14', desktop: 137, mobile: 220 },
+ { date: '2024-04-15', desktop: 120, mobile: 170 },
+ { date: '2024-04-16', desktop: 138, mobile: 190 },
+ { date: '2024-04-17', desktop: 446, mobile: 360 },
+ { date: '2024-04-18', desktop: 364, mobile: 410 },
+ { date: '2024-04-19', desktop: 243, mobile: 180 },
+ { date: '2024-04-20', desktop: 89, mobile: 150 },
+ { date: '2024-04-21', desktop: 137, mobile: 200 },
+ { date: '2024-04-22', desktop: 224, mobile: 170 },
+ { date: '2024-04-23', desktop: 138, mobile: 230 },
+ { date: '2024-04-24', desktop: 387, mobile: 290 },
+ { date: '2024-04-25', desktop: 215, mobile: 250 },
+ { date: '2024-04-26', desktop: 75, mobile: 130 },
+ { date: '2024-04-27', desktop: 383, mobile: 420 },
+ { date: '2024-04-28', desktop: 122, mobile: 180 },
+ { date: '2024-04-29', desktop: 315, mobile: 240 },
+ { date: '2024-04-30', desktop: 454, mobile: 380 },
+ { date: '2024-05-01', desktop: 165, mobile: 220 },
+ { date: '2024-05-02', desktop: 293, mobile: 310 },
+ { date: '2024-05-03', desktop: 247, mobile: 190 },
+ { date: '2024-05-04', desktop: 385, mobile: 420 },
+ { date: '2024-05-05', desktop: 481, mobile: 390 },
+ { date: '2024-05-06', desktop: 498, mobile: 520 },
+ { date: '2024-05-07', desktop: 388, mobile: 300 },
+ { date: '2024-05-08', desktop: 149, mobile: 210 },
+ { date: '2024-05-09', desktop: 227, mobile: 180 },
+ { date: '2024-05-10', desktop: 293, mobile: 330 },
+ { date: '2024-05-11', desktop: 335, mobile: 270 },
+ { date: '2024-05-12', desktop: 197, mobile: 240 },
+ { date: '2024-05-13', desktop: 197, mobile: 160 },
+ { date: '2024-05-14', desktop: 448, mobile: 490 },
+ { date: '2024-05-15', desktop: 473, mobile: 380 },
+ { date: '2024-05-16', desktop: 338, mobile: 400 },
+ { date: '2024-05-17', desktop: 499, mobile: 420 },
+ { date: '2024-05-18', desktop: 315, mobile: 350 },
+ { date: '2024-05-19', desktop: 235, mobile: 180 },
+ { date: '2024-05-20', desktop: 177, mobile: 230 },
+ { date: '2024-05-21', desktop: 82, mobile: 140 },
+ { date: '2024-05-22', desktop: 81, mobile: 120 },
+ { date: '2024-05-23', desktop: 252, mobile: 290 },
+ { date: '2024-05-24', desktop: 294, mobile: 220 },
+ { date: '2024-05-25', desktop: 201, mobile: 250 },
+ { date: '2024-05-26', desktop: 213, mobile: 170 },
+ { date: '2024-05-27', desktop: 420, mobile: 460 },
+ { date: '2024-05-28', desktop: 233, mobile: 190 },
+ { date: '2024-05-29', desktop: 78, mobile: 130 },
+ { date: '2024-05-30', desktop: 340, mobile: 280 },
+ { date: '2024-05-31', desktop: 178, mobile: 230 },
+ { date: '2024-06-01', desktop: 178, mobile: 200 },
+ { date: '2024-06-02', desktop: 470, mobile: 410 },
+ { date: '2024-06-03', desktop: 103, mobile: 160 },
+ { date: '2024-06-04', desktop: 439, mobile: 380 },
+ { date: '2024-06-05', desktop: 88, mobile: 140 },
+ { date: '2024-06-06', desktop: 294, mobile: 250 },
+ { date: '2024-06-07', desktop: 323, mobile: 370 },
+ { date: '2024-06-08', desktop: 385, mobile: 320 },
+ { date: '2024-06-09', desktop: 438, mobile: 480 },
+ { date: '2024-06-10', desktop: 155, mobile: 200 },
+ { date: '2024-06-11', desktop: 92, mobile: 150 },
+ { date: '2024-06-12', desktop: 492, mobile: 420 },
+ { date: '2024-06-13', desktop: 81, mobile: 130 },
+ { date: '2024-06-14', desktop: 426, mobile: 380 },
+ { date: '2024-06-15', desktop: 307, mobile: 350 },
+ { date: '2024-06-16', desktop: 371, mobile: 310 },
+ { date: '2024-06-17', desktop: 475, mobile: 520 },
+ { date: '2024-06-18', desktop: 107, mobile: 170 },
+ { date: '2024-06-19', desktop: 341, mobile: 290 },
+ { date: '2024-06-20', desktop: 408, mobile: 450 },
+ { date: '2024-06-21', desktop: 169, mobile: 210 },
+ { date: '2024-06-22', desktop: 317, mobile: 270 },
+ { date: '2024-06-23', desktop: 480, mobile: 530 },
+ { date: '2024-06-24', desktop: 132, mobile: 180 },
+ { date: '2024-06-25', desktop: 141, mobile: 190 },
+ { date: '2024-06-26', desktop: 434, mobile: 380 },
+ { date: '2024-06-27', desktop: 448, mobile: 490 },
+ { date: '2024-06-28', desktop: 149, mobile: 200 },
+ { date: '2024-06-29', desktop: 103, mobile: 160 },
+ { date: '2024-06-30', desktop: 446, mobile: 400 },
+]
+
+const chartConfig = {
+ views: {
+ label: 'Page Views',
+ },
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ const [activeChart, setActiveChart] = React.useState<keyof typeof chartConfig>('desktop')
+
+ const total = React.useMemo(
+ () => ({
+ desktop: chartData.reduce((acc, curr) => acc + curr.desktop, 0),
+ mobile: chartData.reduce((acc, curr) => acc + curr.mobile, 0),
+ }),
+ []
+ )
+
+ return (
+ <Card>
+ <CardHeader className="flex flex-col items-stretch space-y-0 border-b p-0 sm:flex-row">
+ <div className="flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6">
+ <CardTitle>Line Chart - Interactive</CardTitle>
+ <CardDescription>Showing total visitors for the last 3 months</CardDescription>
+ </div>
+ <div className="flex">
+ {['desktop', 'mobile'].map((key) => {
+ const chart = key as keyof typeof chartConfig
+ return (
+ <button
+ key={chart}
+ data-active={activeChart === chart}
+ className="flex flex-1 flex-col justify-center gap-1 border-t px-6 py-4 text-left even:border-l data-[active=true]:bg-muted/50 sm:border-l sm:border-t-0 sm:px-8 sm:py-6"
+ onClick={() => setActiveChart(chart)}
+ >
+ <span className="text-xs text-muted-foreground">{chartConfig[chart].label}</span>
+ <span className="text-lg font-bold leading-none sm:text-3xl">
+ {total[key as keyof typeof total].toLocaleString()}
+ </span>
+ </button>
+ )
+ })}
+ </div>
+ </CardHeader>
+ <CardContent className="px-2 sm:p-6">
+ <ChartContainer config={chartConfig} className="aspect-auto h-[250px] w-full">
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="date"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ minTickGap={32}
+ tickFormatter={(value) => {
+ const date = new Date(value)
+ return date.toLocaleDateString('en-US', {
+ month: 'short',
+ day: 'numeric',
+ })
+ }}
+ />
+ <ChartTooltip
+ content={
+ <ChartTooltipContent
+ className="w-[150px]"
+ nameKey="views"
+ labelFormatter={(value) => {
+ return new Date(value).toLocaleDateString('en-US', {
+ month: 'short',
+ day: 'numeric',
+ year: 'numeric',
+ })
+ }}
+ />
+ }
+ />
+ <Line
+ dataKey={activeChart}
+ type="monotone"
+ stroke={`var(--color-${activeChart})`}
+ strokeWidth={2}
+ dot={false}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-line-label-custom.tsx b/apps/design-system/__registry__/default/block/chart-line-label-custom.tsx
new file mode 100644
index 00000000000..3d84fec03a3
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-line-label-custom.tsx
@@ -0,0 +1,103 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, LabelList, Line, LineChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A line chart with a custom label'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ color: 'hsl(var(--chart-2))',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Custom Label</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ top: 24,
+ left: 24,
+ right: 24,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent indicator="line" nameKey="visitors" hideLabel />}
+ />
+ <Line
+ dataKey="visitors"
+ type="natural"
+ stroke="var(--color-visitors)"
+ strokeWidth={2}
+ dot={{
+ fill: 'var(--color-visitors)',
+ }}
+ activeDot={{
+ r: 6,
+ }}
+ >
+ <LabelList
+ position="top"
+ offset={12}
+ className="fill-foreground"
+ fontSize={12}
+ dataKey="browser"
+ formatter={(value: keyof typeof chartConfig) => chartConfig[value]?.label}
+ />
+ </Line>
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-line-label.tsx b/apps/design-system/__registry__/default/block/chart-line-label.tsx
new file mode 100644
index 00000000000..2c187e95961
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-line-label.tsx
@@ -0,0 +1,85 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, LabelList, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A line chart with a label'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Label</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ top: 20,
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <Line
+ dataKey="desktop"
+ type="natural"
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ dot={{
+ fill: 'var(--color-desktop)',
+ }}
+ activeDot={{
+ r: 6,
+ }}
+ >
+ <LabelList position="top" offset={12} className="fill-foreground" fontSize={12} />
+ </Line>
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-line-linear.tsx b/apps/design-system/__registry__/default/block/chart-line-linear.tsx
new file mode 100644
index 00000000000..9219a3c9de4
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-line-linear.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A linear line chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Linear</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Line
+ dataKey="desktop"
+ type="linear"
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ dot={false}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-line-multiple.tsx b/apps/design-system/__registry__/default/block/chart-line-multiple.tsx
new file mode 100644
index 00000000000..f09714a2737
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-line-multiple.tsx
@@ -0,0 +1,88 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A multiple line chart'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Multiple</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
+ <Line
+ dataKey="desktop"
+ type="monotone"
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ dot={false}
+ />
+ <Line
+ dataKey="mobile"
+ type="monotone"
+ stroke="var(--color-mobile)"
+ strokeWidth={2}
+ dot={false}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-line-step.tsx b/apps/design-system/__registry__/default/block/chart-line-step.tsx
new file mode 100644
index 00000000000..0ab71e07d09
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-line-step.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A line chart with step'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Step</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Line
+ dataKey="desktop"
+ type="step"
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ dot={false}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-donut-active.tsx b/apps/design-system/__registry__/default/block/chart-pie-donut-active.tsx
new file mode 100644
index 00000000000..2490b50f65f
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-pie-donut-active.tsx
@@ -0,0 +1,81 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Label, Pie, PieChart, Sector } from 'recharts'
+import { PieSectorDataItem } from 'recharts/types/polar/Pie'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A donut chart with an active sector'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Donut Active</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Pie
+ data={chartData}
+ dataKey="visitors"
+ nameKey="browser"
+ innerRadius={60}
+ strokeWidth={5}
+ activeIndex={0}
+ activeShape={({ outerRadius = 0, ...props }: PieSectorDataItem) => (
+ <Sector {...props} outerRadius={outerRadius + 10} />
+ )}
+ />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-donut-text.tsx b/apps/design-system/__registry__/default/block/chart-pie-donut-text.tsx
new file mode 100644
index 00000000000..cba1eee8492
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-pie-donut-text.tsx
@@ -0,0 +1,111 @@
+'use client'
+
+import * as React from 'react'
+import { TrendingUp } from 'lucide-react'
+import { Label, Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A donut chart with text'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 287, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 190, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ const totalVisitors = React.useMemo(() => {
+ return chartData.reduce((acc, curr) => acc + curr.visitors, 0)
+ }, [])
+
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Donut with Text</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Pie
+ data={chartData}
+ dataKey="visitors"
+ nameKey="browser"
+ innerRadius={60}
+ strokeWidth={5}
+ >
+ <Label
+ content={({ viewBox }) => {
+ if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
+ return (
+ <text
+ x={viewBox.cx}
+ y={viewBox.cy}
+ textAnchor="middle"
+ dominantBaseline="middle"
+ >
+ <tspan
+ x={viewBox.cx}
+ y={viewBox.cy}
+ className="fill-foreground text-3xl font-bold"
+ >
+ {totalVisitors.toLocaleString()}
+ </tspan>
+ <tspan
+ x={viewBox.cx}
+ y={(viewBox.cy || 0) + 24}
+ className="fill-muted-foreground"
+ >
+ Visitors
+ </tspan>
+ </text>
+ )
+ }
+ }}
+ />
+ </Pie>
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-donut.tsx b/apps/design-system/__registry__/default/block/chart-pie-donut.tsx
new file mode 100644
index 00000000000..328fbd4b48a
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-pie-donut.tsx
@@ -0,0 +1,70 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A donut chart'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Donut</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Pie data={chartData} dataKey="visitors" nameKey="browser" innerRadius={60} />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-interactive.tsx b/apps/design-system/__registry__/default/block/chart-pie-interactive.tsx
new file mode 100644
index 00000000000..be05cbf8e41
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-pie-interactive.tsx
@@ -0,0 +1,170 @@
+'use client'
+
+import * as React from 'react'
+import { Label, Pie, PieChart, Sector } from 'recharts'
+import { PieSectorDataItem } from 'recharts/types/polar/Pie'
+
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartStyle, ChartTooltip, ChartTooltipContent } from 'ui'
+import {
+ Select_Shadcn_,
+ SelectContent_Shadcn_,
+ SelectItem_Shadcn_,
+ SelectTrigger_Shadcn_,
+ SelectValue_Shadcn_,
+} from 'ui'
+
+export const description = 'An interactive pie chart'
+
+const desktopData = [
+ { month: 'january', desktop: 186, fill: 'var(--color-january)' },
+ { month: 'february', desktop: 305, fill: 'var(--color-february)' },
+ { month: 'march', desktop: 237, fill: 'var(--color-march)' },
+ { month: 'april', desktop: 173, fill: 'var(--color-april)' },
+ { month: 'may', desktop: 209, fill: 'var(--color-may)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ desktop: {
+ label: 'Desktop',
+ },
+ mobile: {
+ label: 'Mobile',
+ },
+ january: {
+ label: 'January',
+ color: 'hsl(var(--chart-1))',
+ },
+ february: {
+ label: 'February',
+ color: 'hsl(var(--chart-2))',
+ },
+ march: {
+ label: 'March',
+ color: 'hsl(var(--chart-3))',
+ },
+ april: {
+ label: 'April',
+ color: 'hsl(var(--chart-4))',
+ },
+ may: {
+ label: 'May',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ const id = 'pie-interactive'
+ const [activeMonth, setActiveMonth] = React.useState(desktopData[0].month)
+
+ const activeIndex = React.useMemo(
+ () => desktopData.findIndex((item) => item.month === activeMonth),
+ [activeMonth]
+ )
+ const months = React.useMemo(() => desktopData.map((item) => item.month), [])
+
+ return (
+ <Card data-chart={id} className="flex flex-col">
+ <ChartStyle id={id} config={chartConfig} />
+ <CardHeader className="flex-row items-start space-y-0 pb-0">
+ <div className="grid gap-1">
+ <CardTitle>Pie Chart - Interactive</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </div>
+ <Select_Shadcn_ value={activeMonth} onValueChange={setActiveMonth}>
+ <SelectTrigger_Shadcn_
+ className="ml-auto h-7 w-[130px] rounded-lg pl-2.5"
+ aria-label="Select a value"
+ >
+ <SelectValue_Shadcn_ placeholder="Select month" />
+ </SelectTrigger_Shadcn_>
+ <SelectContent_Shadcn_ align="end" className="rounded-xl">
+ {months.map((key) => {
+ const config = chartConfig[key as keyof typeof chartConfig]
+
+ if (!config) {
+ return null
+ }
+
+ return (
+ <SelectItem_Shadcn_ key={key} value={key} className="rounded-lg [&_span]:flex">
+ <div className="flex items-center gap-2 text-xs">
+ <span
+ className="flex h-3 w-3 shrink-0 rounded-sm"
+ style={{
+ backgroundColor: `var(--color-${key})`,
+ }}
+ />
+ {config?.label}
+ </div>
+ </SelectItem_Shadcn_>
+ )
+ })}
+ </SelectContent_Shadcn_>
+ </Select_Shadcn_>
+ </CardHeader>
+ <CardContent className="flex flex-1 justify-center pb-0">
+ <ChartContainer
+ id={id}
+ config={chartConfig}
+ className="mx-auto aspect-square w-full max-w-[300px]"
+ >
+ <PieChart>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Pie
+ data={desktopData}
+ dataKey="desktop"
+ nameKey="month"
+ innerRadius={60}
+ strokeWidth={5}
+ activeIndex={activeIndex}
+ activeShape={({ outerRadius = 0, ...props }: PieSectorDataItem) => (
+ <g>
+ <Sector {...props} outerRadius={outerRadius + 10} />
+ <Sector
+ {...props}
+ outerRadius={outerRadius + 25}
+ innerRadius={outerRadius + 12}
+ />
+ </g>
+ )}
+ >
+ <Label
+ content={({ viewBox }) => {
+ if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
+ return (
+ <text
+ x={viewBox.cx}
+ y={viewBox.cy}
+ textAnchor="middle"
+ dominantBaseline="middle"
+ >
+ <tspan
+ x={viewBox.cx}
+ y={viewBox.cy}
+ className="fill-foreground text-3xl font-bold"
+ >
+ {desktopData[activeIndex].desktop.toLocaleString()}
+ </tspan>
+ <tspan
+ x={viewBox.cx}
+ y={(viewBox.cy || 0) + 24}
+ className="fill-muted-foreground"
+ >
+ Visitors
+ </tspan>
+ </text>
+ )
+ }
+ }}
+ />
+ </Pie>
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-label-custom.tsx b/apps/design-system/__registry__/default/block/chart-pie-label-custom.tsx
new file mode 100644
index 00000000000..5fcae35aabe
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-pie-label-custom.tsx
@@ -0,0 +1,92 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A pie chart with a custom label'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Custom Label</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip content={<ChartTooltipContent nameKey="visitors" hideLabel />} />
+ <Pie
+ data={chartData}
+ dataKey="visitors"
+ labelLine={false}
+ label={({ payload, ...props }) => {
+ return (
+ <text
+ cx={props.cx}
+ cy={props.cy}
+ x={props.x}
+ y={props.y}
+ textAnchor={props.textAnchor}
+ dominantBaseline={props.dominantBaseline}
+ fill="hsla(var(--foreground))"
+ >
+ {`${
+ chartConfig[payload.browser as keyof typeof chartConfig]?.label
+ } (${payload.visitors})`}
+ </text>
+ )
+ }}
+ nameKey="browser"
+ />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-label-list.tsx b/apps/design-system/__registry__/default/block/chart-pie-label-list.tsx
new file mode 100644
index 00000000000..814371c307e
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-pie-label-list.tsx
@@ -0,0 +1,78 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { LabelList, Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A pie chart with a label list'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Label List</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip content={<ChartTooltipContent nameKey="visitors" hideLabel />} />
+ <Pie data={chartData} dataKey="visitors">
+ <LabelList
+ dataKey="browser"
+ className="fill-background"
+ stroke="none"
+ fontSize={12}
+ formatter={(value: keyof typeof chartConfig) => chartConfig[value]?.label}
+ />
+ </Pie>
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-label.tsx b/apps/design-system/__registry__/default/block/chart-pie-label.tsx
new file mode 100644
index 00000000000..408bd68fb95
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-pie-label.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A pie chart with a label'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Label</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer
+ config={chartConfig}
+ className="mx-auto aspect-square max-h-[250px] pb-0 [&_.recharts-pie-label-text]:fill-foreground"
+ >
+ <PieChart>
+ <ChartTooltip content={<ChartTooltipContent hideLabel />} />
+ <Pie data={chartData} dataKey="visitors" label nameKey="browser" />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-legend.tsx b/apps/design-system/__registry__/default/block/chart-pie-legend.tsx
new file mode 100644
index 00000000000..c72830caf17
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-pie-legend.tsx
@@ -0,0 +1,64 @@
+'use client'
+
+import { Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent } from 'ui'
+
+export const description = 'A pie chart with a legend'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Legend</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[300px]">
+ <PieChart>
+ <Pie data={chartData} dataKey="visitors" />
+ <ChartLegend
+ content={<ChartLegendContent nameKey="browser" />}
+ className="-translate-y-2 flex-wrap gap-2 [&>*]:basis-1/4 [&>*]:justify-center"
+ />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-separator-none.tsx b/apps/design-system/__registry__/default/block/chart-pie-separator-none.tsx
new file mode 100644
index 00000000000..ed00866c3b8
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-pie-separator-none.tsx
@@ -0,0 +1,70 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A pie chart with no separator'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Separator None</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Pie data={chartData} dataKey="visitors" nameKey="browser" stroke="0" />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-simple.tsx b/apps/design-system/__registry__/default/block/chart-pie-simple.tsx
new file mode 100644
index 00000000000..a16fb87ca56
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-pie-simple.tsx
@@ -0,0 +1,70 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A simple pie chart'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Pie data={chartData} dataKey="visitors" nameKey="browser" />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-stacked.tsx b/apps/design-system/__registry__/default/block/chart-pie-stacked.tsx
new file mode 100644
index 00000000000..a2ab16ba711
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-pie-stacked.tsx
@@ -0,0 +1,97 @@
+'use client'
+
+import * as React from 'react'
+import { TrendingUp } from 'lucide-react'
+import { Label, Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A pie chart with stacked sections'
+
+const desktopData = [
+ { month: 'january', desktop: 186, fill: 'var(--color-january)' },
+ { month: 'february', desktop: 305, fill: 'var(--color-february)' },
+ { month: 'march', desktop: 237, fill: 'var(--color-march)' },
+ { month: 'april', desktop: 173, fill: 'var(--color-april)' },
+ { month: 'may', desktop: 209, fill: 'var(--color-may)' },
+]
+
+const mobileData = [
+ { month: 'january', mobile: 80, fill: 'var(--color-january)' },
+ { month: 'february', mobile: 200, fill: 'var(--color-february)' },
+ { month: 'march', mobile: 120, fill: 'var(--color-march)' },
+ { month: 'april', mobile: 190, fill: 'var(--color-april)' },
+ { month: 'may', mobile: 130, fill: 'var(--color-may)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ desktop: {
+ label: 'Desktop',
+ },
+ mobile: {
+ label: 'Mobile',
+ },
+ january: {
+ label: 'January',
+ color: 'hsl(var(--chart-1))',
+ },
+ february: {
+ label: 'February',
+ color: 'hsl(var(--chart-2))',
+ },
+ march: {
+ label: 'March',
+ color: 'hsl(var(--chart-3))',
+ },
+ april: {
+ label: 'April',
+ color: 'hsl(var(--chart-4))',
+ },
+ may: {
+ label: 'May',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Stacked</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip
+ content={
+ <ChartTooltipContent
+ labelKey="visitors"
+ nameKey="month"
+ indicator="line"
+ labelFormatter={(_, payload) => {
+ return chartConfig[payload?.[0].dataKey as keyof typeof chartConfig].label
+ }}
+ />
+ }
+ />
+ <Pie data={desktopData} dataKey="desktop" outerRadius={60} />
+ <Pie data={mobileData} dataKey="mobile" innerRadius={70} outerRadius={90} />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-default.tsx b/apps/design-system/__registry__/default/block/chart-radar-default.tsx
new file mode 100644
index 00000000000..dc3d4e6d553
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radar-default.tsx
@@ -0,0 +1,54 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 273 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
+ <PolarAngleAxis dataKey="month" />
+ <PolarGrid />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-dots.tsx b/apps/design-system/__registry__/default/block/chart-radar-dots.tsx
new file mode 100644
index 00000000000..bedf14de29b
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radar-dots.tsx
@@ -0,0 +1,62 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with dots'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 273 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center">
+ <CardTitle>Radar Chart - Dots</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
+ <PolarAngleAxis dataKey="month" />
+ <PolarGrid />
+ <Radar
+ dataKey="desktop"
+ fill="var(--color-desktop)"
+ fillOpacity={0.6}
+ dot={{
+ r: 4,
+ fillOpacity: 1,
+ }}
+ />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-grid-circle-fill.tsx b/apps/design-system/__registry__/default/block/chart-radar-grid-circle-fill.tsx
new file mode 100644
index 00000000000..d17d1536225
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radar-grid-circle-fill.tsx
@@ -0,0 +1,54 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with a grid and circle fill'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 285 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 203 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 264 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Grid Circle Filled</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
+ <PolarGrid className="fill-[--color-desktop] opacity-20" gridType="circle" />
+ <PolarAngleAxis dataKey="month" />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.5} />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-grid-circle-no-lines.tsx b/apps/design-system/__registry__/default/block/chart-radar-grid-circle-no-lines.tsx
new file mode 100644
index 00000000000..3e602ac5745
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radar-grid-circle-no-lines.tsx
@@ -0,0 +1,62 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with a grid and circle fill'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 203 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Grid Circle - No lines</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <PolarGrid gridType="circle" radialLines={false} />
+ <PolarAngleAxis dataKey="month" />
+ <Radar
+ dataKey="desktop"
+ fill="var(--color-desktop)"
+ fillOpacity={0.6}
+ dot={{
+ r: 4,
+ fillOpacity: 1,
+ }}
+ />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-grid-circle.tsx b/apps/design-system/__registry__/default/block/chart-radar-grid-circle.tsx
new file mode 100644
index 00000000000..0cc0277a0c4
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radar-grid-circle.tsx
@@ -0,0 +1,62 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with a grid and circle'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 273 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Grid Circle</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <PolarGrid gridType="circle" />
+ <PolarAngleAxis dataKey="month" />
+ <Radar
+ dataKey="desktop"
+ fill="var(--color-desktop)"
+ fillOpacity={0.6}
+ dot={{
+ r: 4,
+ fillOpacity: 1,
+ }}
+ />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-grid-custom.tsx b/apps/design-system/__registry__/default/block/chart-radar-grid-custom.tsx
new file mode 100644
index 00000000000..31614acc9a3
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radar-grid-custom.tsx
@@ -0,0 +1,54 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with a custom grid'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 273 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Grid Custom</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <PolarGrid radialLines={false} polarRadius={[90]} strokeWidth={1} />
+ <PolarAngleAxis dataKey="month" />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-grid-fill.tsx b/apps/design-system/__registry__/default/block/chart-radar-grid-fill.tsx
new file mode 100644
index 00000000000..7745a10fb13
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radar-grid-fill.tsx
@@ -0,0 +1,54 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with a grid filled'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 285 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 203 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 264 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Grid Filled</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <PolarGrid className="fill-[--color-desktop] opacity-20" />
+ <PolarAngleAxis dataKey="month" />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.5} />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-grid-none.tsx b/apps/design-system/__registry__/default/block/chart-radar-grid-none.tsx
new file mode 100644
index 00000000000..a75ac15da18
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radar-grid-none.tsx
@@ -0,0 +1,61 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with no grid'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 273 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Grid None</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <PolarAngleAxis dataKey="month" />
+ <Radar
+ dataKey="desktop"
+ fill="var(--color-desktop)"
+ fillOpacity={0.6}
+ dot={{
+ r: 4,
+ fillOpacity: 1,
+ }}
+ />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-icons.tsx b/apps/design-system/__registry__/default/block/chart-radar-icons.tsx
new file mode 100644
index 00000000000..b2a83ad3934
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radar-icons.tsx
@@ -0,0 +1,75 @@
+'use client'
+
+import { ArrowDownFromLine, ArrowUpFromLine, TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import {
+ ChartConfig,
+ ChartContainer,
+ ChartLegend,
+ ChartLegendContent,
+ ChartTooltip,
+ ChartTooltipContent,
+} from 'ui'
+
+export const description = 'A radar chart with icons'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ icon: ArrowDownFromLine,
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ icon: ArrowUpFromLine,
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Icons</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart
+ data={chartData}
+ margin={{
+ top: -40,
+ bottom: -10,
+ }}
+ >
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <PolarAngleAxis dataKey="month" />
+ <PolarGrid />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
+ <Radar dataKey="mobile" fill="var(--color-mobile)" />
+ <ChartLegend className="mt-8" content={<ChartLegendContent />} />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 pt-4 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-label-custom.tsx b/apps/design-system/__registry__/default/block/chart-radar-label-custom.tsx
new file mode 100644
index 00000000000..51edad28517
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radar-label-custom.tsx
@@ -0,0 +1,91 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with a custom label'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Custom Label</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart
+ data={chartData}
+ margin={{
+ top: 10,
+ right: 10,
+ bottom: 10,
+ left: 10,
+ }}
+ >
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <PolarAngleAxis
+ dataKey="month"
+ tick={({ x, y, textAnchor, value, index, ...props }) => {
+ const data = chartData[index]
+
+ return (
+ <text
+ x={x}
+ y={index === 0 ? y - 10 : y}
+ textAnchor={textAnchor}
+ fontSize={13}
+ fontWeight={500}
+ {...props}
+ >
+ <tspan>{data.desktop}</tspan>
+ <tspan className="fill-muted-foreground">/</tspan>
+ <tspan>{data.mobile}</tspan>
+ <tspan x={x} dy={'1rem'} fontSize={12} className="fill-muted-foreground">
+ {data.month}
+ </tspan>
+ </text>
+ )
+ }}
+ />
+
+ <PolarGrid />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
+ <Radar dataKey="mobile" fill="var(--color-mobile)" />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-legend.tsx b/apps/design-system/__registry__/default/block/chart-radar-legend.tsx
new file mode 100644
index 00000000000..1500cc422a3
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radar-legend.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import {
+ ChartConfig,
+ ChartContainer,
+ ChartLegend,
+ ChartLegendContent,
+ ChartTooltip,
+ ChartTooltipContent,
+} from 'ui'
+
+export const description = 'A radar chart with a legend'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Legend</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart
+ data={chartData}
+ margin={{
+ top: -40,
+ bottom: -10,
+ }}
+ >
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <PolarAngleAxis dataKey="month" />
+ <PolarGrid />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
+ <Radar dataKey="mobile" fill="var(--color-mobile)" />
+ <ChartLegend className="mt-8" content={<ChartLegendContent />} />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 pt-4 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-lines-only.tsx b/apps/design-system/__registry__/default/block/chart-radar-lines-only.tsx
new file mode 100644
index 00000000000..acb880c81c3
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radar-lines-only.tsx
@@ -0,0 +1,71 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with lines only'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 160 },
+ { month: 'February', desktop: 185, mobile: 170 },
+ { month: 'March', desktop: 207, mobile: 180 },
+ { month: 'April', desktop: 173, mobile: 160 },
+ { month: 'May', desktop: 160, mobile: 190 },
+ { month: 'June', desktop: 174, mobile: 204 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Lines Only</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <PolarAngleAxis dataKey="month" />
+ <PolarGrid radialLines={false} />
+ <Radar
+ dataKey="desktop"
+ fill="var(--color-desktop)"
+ fillOpacity={0}
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ />
+ <Radar
+ dataKey="mobile"
+ fill="var(--color-mobile)"
+ fillOpacity={0}
+ stroke="var(--color-mobile)"
+ strokeWidth={2}
+ />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-multiple.tsx b/apps/design-system/__registry__/default/block/chart-radar-multiple.tsx
new file mode 100644
index 00000000000..5cc44043950
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radar-multiple.tsx
@@ -0,0 +1,59 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with multiple data'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Multiple</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <PolarAngleAxis dataKey="month" />
+ <PolarGrid />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
+ <Radar dataKey="mobile" fill="var(--color-mobile)" />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-radius.tsx b/apps/design-system/__registry__/default/block/chart-radar-radius.tsx
new file mode 100644
index 00000000000..f6616c4ac00
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radar-radius.tsx
@@ -0,0 +1,67 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with a radius axis'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Radius Axis</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent indicator="line" labelKey="month" />}
+ />
+ <PolarGrid />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
+ <Radar dataKey="mobile" fill="var(--color-mobile)" />
+ <PolarRadiusAxis
+ angle={60}
+ stroke="hsla(var(--foreground))"
+ orientation="middle"
+ axisLine={false}
+ />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radial-grid.tsx b/apps/design-system/__registry__/default/block/chart-radial-grid.tsx
new file mode 100644
index 00000000000..fea6deab0c2
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radial-grid.tsx
@@ -0,0 +1,74 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarGrid, RadialBar, RadialBarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radial chart with a grid'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Radial Chart - Grid</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadialBarChart data={chartData} innerRadius={30} outerRadius={100}>
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent hideLabel nameKey="browser" />}
+ />
+ <PolarGrid gridType="circle" />
+ <RadialBar dataKey="visitors" />
+ </RadialBarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radial-label.tsx b/apps/design-system/__registry__/default/block/chart-radial-label.tsx
new file mode 100644
index 00000000000..073e8b4ed47
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radial-label.tsx
@@ -0,0 +1,86 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { LabelList, RadialBar, RadialBarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radial chart with a label'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Radial Chart - Label</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadialBarChart
+ data={chartData}
+ startAngle={-90}
+ endAngle={380}
+ innerRadius={30}
+ outerRadius={110}
+ >
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent hideLabel nameKey="browser" />}
+ />
+ <RadialBar dataKey="visitors" background>
+ <LabelList
+ position="insideStart"
+ dataKey="browser"
+ className="fill-white capitalize mix-blend-luminosity"
+ fontSize={11}
+ />
+ </RadialBar>
+ </RadialBarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radial-shape.tsx b/apps/design-system/__registry__/default/block/chart-radial-shape.tsx
new file mode 100644
index 00000000000..120a2df88d4
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radial-shape.tsx
@@ -0,0 +1,85 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Label, PolarGrid, PolarRadiusAxis, RadialBar, RadialBarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer } from 'ui'
+
+export const description = 'A radial chart with a custom shape'
+
+const chartData = [{ browser: 'safari', visitors: 1260, fill: 'var(--color-safari)' }]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Radial Chart - Shape</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadialBarChart data={chartData} endAngle={100} innerRadius={80} outerRadius={140}>
+ <PolarGrid
+ gridType="circle"
+ radialLines={false}
+ stroke="none"
+ className="first:fill-muted last:fill-background"
+ polarRadius={[86, 74]}
+ />
+ <RadialBar dataKey="visitors" background />
+ <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
+ <Label
+ content={({ viewBox }) => {
+ if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
+ return (
+ <text
+ x={viewBox.cx}
+ y={viewBox.cy}
+ textAnchor="middle"
+ dominantBaseline="middle"
+ >
+ <tspan
+ x={viewBox.cx}
+ y={viewBox.cy}
+ className="fill-foreground text-4xl font-bold"
+ >
+ {chartData[0].visitors.toLocaleString()}
+ </tspan>
+ <tspan
+ x={viewBox.cx}
+ y={(viewBox.cy || 0) + 24}
+ className="fill-muted-foreground"
+ >
+ Visitors
+ </tspan>
+ </text>
+ )
+ }
+ }}
+ />
+ </PolarRadiusAxis>
+ </RadialBarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radial-simple.tsx b/apps/design-system/__registry__/default/block/chart-radial-simple.tsx
new file mode 100644
index 00000000000..6c7590b2573
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radial-simple.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { RadialBar, RadialBarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radial chart'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Radial Chart</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadialBarChart data={chartData} innerRadius={30} outerRadius={110}>
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent hideLabel nameKey="browser" />}
+ />
+ <RadialBar dataKey="visitors" background />
+ </RadialBarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radial-stacked.tsx b/apps/design-system/__registry__/default/block/chart-radial-stacked.tsx
new file mode 100644
index 00000000000..e38791f9bae
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radial-stacked.tsx
@@ -0,0 +1,90 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Label, PolarRadiusAxis, RadialBar, RadialBarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radial chart with stacked sections'
+
+const chartData = [{ month: 'january', desktop: 1260, mobile: 570 }]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ const totalVisitors = chartData[0].desktop + chartData[0].mobile
+
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Radial Chart - Stacked</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex flex-1 items-center pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square w-full max-w-[250px]">
+ <RadialBarChart data={chartData} endAngle={180} innerRadius={80} outerRadius={130}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
+ <Label
+ content={({ viewBox }) => {
+ if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
+ return (
+ <text x={viewBox.cx} y={viewBox.cy} textAnchor="middle">
+ <tspan
+ x={viewBox.cx}
+ y={(viewBox.cy || 0) - 16}
+ className="fill-foreground text-2xl font-bold"
+ >
+ {totalVisitors.toLocaleString()}
+ </tspan>
+ <tspan
+ x={viewBox.cx}
+ y={(viewBox.cy || 0) + 4}
+ className="fill-muted-foreground"
+ >
+ Visitors
+ </tspan>
+ </text>
+ )
+ }
+ }}
+ />
+ </PolarRadiusAxis>
+ <RadialBar
+ dataKey="desktop"
+ stackId="a"
+ cornerRadius={5}
+ fill="var(--color-desktop)"
+ className="stroke-transparent stroke-2"
+ />
+ <RadialBar
+ dataKey="mobile"
+ fill="var(--color-mobile)"
+ stackId="a"
+ cornerRadius={5}
+ className="stroke-transparent stroke-2"
+ />
+ </RadialBarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-radial-text.tsx b/apps/design-system/__registry__/default/block/chart-radial-text.tsx
new file mode 100644
index 00000000000..8dd238c505b
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-radial-text.tsx
@@ -0,0 +1,91 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Label, PolarGrid, PolarRadiusAxis, RadialBar, RadialBarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer } from 'ui'
+
+export const description = 'A radial chart with text'
+
+const chartData = [{ browser: 'safari', visitors: 200, fill: 'var(--color-safari)' }]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Radial Chart - Text</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadialBarChart
+ data={chartData}
+ startAngle={0}
+ endAngle={250}
+ innerRadius={80}
+ outerRadius={110}
+ >
+ <PolarGrid
+ gridType="circle"
+ radialLines={false}
+ stroke="none"
+ className="first:fill-muted last:fill-background"
+ polarRadius={[86, 74]}
+ />
+ <RadialBar dataKey="visitors" background cornerRadius={10} />
+ <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
+ <Label
+ content={({ viewBox }) => {
+ if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
+ return (
+ <text
+ x={viewBox.cx}
+ y={viewBox.cy}
+ textAnchor="middle"
+ dominantBaseline="middle"
+ >
+ <tspan
+ x={viewBox.cx}
+ y={viewBox.cy}
+ className="fill-foreground text-4xl font-bold"
+ >
+ {chartData[0].visitors.toLocaleString()}
+ </tspan>
+ <tspan
+ x={viewBox.cx}
+ y={(viewBox.cy || 0) + 24}
+ className="fill-muted-foreground"
+ >
+ Visitors
+ </tspan>
+ </text>
+ )
+ }
+ }}
+ />
+ </PolarRadiusAxis>
+ </RadialBarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/__registry__/index.tsx b/apps/design-system/__registry__/index.tsx
index 5c7e7d1f248..d8737bbeca6 100644
--- a/apps/design-system/__registry__/index.tsx
+++ b/apps/design-system/__registry__/index.tsx
@@ -2018,5 +2018,742 @@ export const Index: Record<string, any> = {
subcategory: "undefined",
chunks: []
},
+ "chart-bar-demo": {
+ name: "chart-bar-demo",
+ type: "components:example",
+ registryDependencies: undefined,
+ component: React.lazy(() => import("@/registry/default/example/chart-bar-demo")),
+ source: "",
+ files: ["registry/default/example/chart-bar-demo.tsx"],
+ category: "undefined",
+ subcategory: "undefined",
+ chunks: []
+ },
+ "chart-bar-demo-grid": {
+ name: "chart-bar-demo-grid",
+ type: "components:example",
+ registryDependencies: undefined,
+ component: React.lazy(() => import("@/registry/default/example/chart-bar-demo-grid")),
+ source: "",
+ files: ["registry/default/example/chart-bar-demo-grid.tsx"],
+ category: "undefined",
+ subcategory: "undefined",
+ chunks: []
+ },
+ "chart-bar-demo-axis": {
+ name: "chart-bar-demo-axis",
+ type: "components:example",
+ registryDependencies: undefined,
+ component: React.lazy(() => import("@/registry/default/example/chart-bar-demo-axis")),
+ source: "",
+ files: ["registry/default/example/chart-bar-demo-axis.tsx"],
+ category: "undefined",
+ subcategory: "undefined",
+ chunks: []
+ },
+ "chart-bar-demo-tooltip": {
+ name: "chart-bar-demo-tooltip",
+ type: "components:example",
+ registryDependencies: undefined,
+ component: React.lazy(() => import("@/registry/default/example/chart-bar-demo-tooltip")),
+ source: "",
+ files: ["registry/default/example/chart-bar-demo-tooltip.tsx"],
+ category: "undefined",
+ subcategory: "undefined",
+ chunks: []
+ },
+ "chart-bar-demo-legend": {
+ name: "chart-bar-demo-legend",
+ type: "components:example",
+ registryDependencies: undefined,
+ component: React.lazy(() => import("@/registry/default/example/chart-bar-demo-legend")),
+ source: "",
+ files: ["registry/default/example/chart-bar-demo-legend.tsx"],
+ category: "undefined",
+ subcategory: "undefined",
+ chunks: []
+ },
+ "chart-tooltip-demo": {
+ name: "chart-tooltip-demo",
+ type: "components:example",
+ registryDependencies: undefined,
+ component: React.lazy(() => import("@/registry/default/example/chart-tooltip-demo")),
+ source: "",
+ files: ["registry/default/example/chart-tooltip-demo.tsx"],
+ category: "undefined",
+ subcategory: "undefined",
+ chunks: []
+ },
+ "chart-area-axes": {
+ name: "chart-area-axes",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-area-axes")),
+ source: "__registry__/default/block/chart-area-axes.tsx",
+ files: ["registry/default/block/chart-area-axes.tsx"],
+ category: "Charts",
+ subcategory: "Area",
+ chunks: []
+ },
+ "chart-area-default": {
+ name: "chart-area-default",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-area-default")),
+ source: "__registry__/default/block/chart-area-default.tsx",
+ files: ["registry/default/block/chart-area-default.tsx"],
+ category: "Charts",
+ subcategory: "Area",
+ chunks: []
+ },
+ "chart-area-gradient": {
+ name: "chart-area-gradient",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-area-gradient")),
+ source: "__registry__/default/block/chart-area-gradient.tsx",
+ files: ["registry/default/block/chart-area-gradient.tsx"],
+ category: "Charts",
+ subcategory: "Area",
+ chunks: []
+ },
+ "chart-area-icons": {
+ name: "chart-area-icons",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-area-icons")),
+ source: "__registry__/default/block/chart-area-icons.tsx",
+ files: ["registry/default/block/chart-area-icons.tsx"],
+ category: "Charts",
+ subcategory: "Area",
+ chunks: []
+ },
+ "chart-area-interactive": {
+ name: "chart-area-interactive",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-area-interactive")),
+ source: "__registry__/default/block/chart-area-interactive.tsx",
+ files: ["registry/default/block/chart-area-interactive.tsx"],
+ category: "Charts",
+ subcategory: "Area",
+ chunks: []
+ },
+ "chart-area-legend": {
+ name: "chart-area-legend",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-area-legend")),
+ source: "__registry__/default/block/chart-area-legend.tsx",
+ files: ["registry/default/block/chart-area-legend.tsx"],
+ category: "Charts",
+ subcategory: "Area",
+ chunks: []
+ },
+ "chart-area-linear": {
+ name: "chart-area-linear",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-area-linear")),
+ source: "__registry__/default/block/chart-area-linear.tsx",
+ files: ["registry/default/block/chart-area-linear.tsx"],
+ category: "Charts",
+ subcategory: "Area",
+ chunks: []
+ },
+ "chart-area-stacked-expand": {
+ name: "chart-area-stacked-expand",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-area-stacked-expand")),
+ source: "__registry__/default/block/chart-area-stacked-expand.tsx",
+ files: ["registry/default/block/chart-area-stacked-expand.tsx"],
+ category: "Charts",
+ subcategory: "Area",
+ chunks: []
+ },
+ "chart-area-stacked": {
+ name: "chart-area-stacked",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-area-stacked")),
+ source: "__registry__/default/block/chart-area-stacked.tsx",
+ files: ["registry/default/block/chart-area-stacked.tsx"],
+ category: "Charts",
+ subcategory: "Area",
+ chunks: []
+ },
+ "chart-area-step": {
+ name: "chart-area-step",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-area-step")),
+ source: "__registry__/default/block/chart-area-step.tsx",
+ files: ["registry/default/block/chart-area-step.tsx"],
+ category: "Charts",
+ subcategory: "Area",
+ chunks: []
+ },
+ "chart-bar-active": {
+ name: "chart-bar-active",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-bar-active")),
+ source: "__registry__/default/block/chart-bar-active.tsx",
+ files: ["registry/default/block/chart-bar-active.tsx"],
+ category: "Charts",
+ subcategory: "Bar",
+ chunks: []
+ },
+ "chart-bar-default": {
+ name: "chart-bar-default",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-bar-default")),
+ source: "__registry__/default/block/chart-bar-default.tsx",
+ files: ["registry/default/block/chart-bar-default.tsx"],
+ category: "Charts",
+ subcategory: "Bar",
+ chunks: []
+ },
+ "chart-bar-horizontal": {
+ name: "chart-bar-horizontal",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-bar-horizontal")),
+ source: "__registry__/default/block/chart-bar-horizontal.tsx",
+ files: ["registry/default/block/chart-bar-horizontal.tsx"],
+ category: "Charts",
+ subcategory: "Bar",
+ chunks: []
+ },
+ "chart-bar-interactive": {
+ name: "chart-bar-interactive",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-bar-interactive")),
+ source: "__registry__/default/block/chart-bar-interactive.tsx",
+ files: ["registry/default/block/chart-bar-interactive.tsx"],
+ category: "Charts",
+ subcategory: "Bar",
+ chunks: []
+ },
+ "chart-bar-label-custom": {
+ name: "chart-bar-label-custom",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-bar-label-custom")),
+ source: "__registry__/default/block/chart-bar-label-custom.tsx",
+ files: ["registry/default/block/chart-bar-label-custom.tsx"],
+ category: "Charts",
+ subcategory: "Bar",
+ chunks: []
+ },
+ "chart-bar-label": {
+ name: "chart-bar-label",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-bar-label")),
+ source: "__registry__/default/block/chart-bar-label.tsx",
+ files: ["registry/default/block/chart-bar-label.tsx"],
+ category: "Charts",
+ subcategory: "Bar",
+ chunks: []
+ },
+ "chart-bar-mixed": {
+ name: "chart-bar-mixed",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-bar-mixed")),
+ source: "__registry__/default/block/chart-bar-mixed.tsx",
+ files: ["registry/default/block/chart-bar-mixed.tsx"],
+ category: "Charts",
+ subcategory: "Bar",
+ chunks: []
+ },
+ "chart-bar-multiple": {
+ name: "chart-bar-multiple",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-bar-multiple")),
+ source: "__registry__/default/block/chart-bar-multiple.tsx",
+ files: ["registry/default/block/chart-bar-multiple.tsx"],
+ category: "Charts",
+ subcategory: "Bar",
+ chunks: []
+ },
+ "chart-bar-negative": {
+ name: "chart-bar-negative",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-bar-negative")),
+ source: "__registry__/default/block/chart-bar-negative.tsx",
+ files: ["registry/default/block/chart-bar-negative.tsx"],
+ category: "Charts",
+ subcategory: "Bar",
+ chunks: []
+ },
+ "chart-bar-stacked": {
+ name: "chart-bar-stacked",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-bar-stacked")),
+ source: "__registry__/default/block/chart-bar-stacked.tsx",
+ files: ["registry/default/block/chart-bar-stacked.tsx"],
+ category: "Charts",
+ subcategory: "Bar",
+ chunks: []
+ },
+ "chart-line-default": {
+ name: "chart-line-default",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-line-default")),
+ source: "__registry__/default/block/chart-line-default.tsx",
+ files: ["registry/default/block/chart-line-default.tsx"],
+ category: "Charts",
+ subcategory: "Line",
+ chunks: []
+ },
+ "chart-line-dots-colors": {
+ name: "chart-line-dots-colors",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-line-dots-colors")),
+ source: "__registry__/default/block/chart-line-dots-colors.tsx",
+ files: ["registry/default/block/chart-line-dots-colors.tsx"],
+ category: "Charts",
+ subcategory: "Line",
+ chunks: []
+ },
+ "chart-line-dots-custom": {
+ name: "chart-line-dots-custom",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-line-dots-custom")),
+ source: "__registry__/default/block/chart-line-dots-custom.tsx",
+ files: ["registry/default/block/chart-line-dots-custom.tsx"],
+ category: "Charts",
+ subcategory: "Line",
+ chunks: []
+ },
+ "chart-line-dots": {
+ name: "chart-line-dots",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-line-dots")),
+ source: "__registry__/default/block/chart-line-dots.tsx",
+ files: ["registry/default/block/chart-line-dots.tsx"],
+ category: "Charts",
+ subcategory: "Line",
+ chunks: []
+ },
+ "chart-line-interactive": {
+ name: "chart-line-interactive",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-line-interactive")),
+ source: "__registry__/default/block/chart-line-interactive.tsx",
+ files: ["registry/default/block/chart-line-interactive.tsx"],
+ category: "Charts",
+ subcategory: "Line",
+ chunks: []
+ },
+ "chart-line-label-custom": {
+ name: "chart-line-label-custom",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-line-label-custom")),
+ source: "__registry__/default/block/chart-line-label-custom.tsx",
+ files: ["registry/default/block/chart-line-label-custom.tsx"],
+ category: "Charts",
+ subcategory: "Line",
+ chunks: []
+ },
+ "chart-line-label": {
+ name: "chart-line-label",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-line-label")),
+ source: "__registry__/default/block/chart-line-label.tsx",
+ files: ["registry/default/block/chart-line-label.tsx"],
+ category: "Charts",
+ subcategory: "Line",
+ chunks: []
+ },
+ "chart-line-linear": {
+ name: "chart-line-linear",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-line-linear")),
+ source: "__registry__/default/block/chart-line-linear.tsx",
+ files: ["registry/default/block/chart-line-linear.tsx"],
+ category: "Charts",
+ subcategory: "Line",
+ chunks: []
+ },
+ "chart-line-multiple": {
+ name: "chart-line-multiple",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-line-multiple")),
+ source: "__registry__/default/block/chart-line-multiple.tsx",
+ files: ["registry/default/block/chart-line-multiple.tsx"],
+ category: "Charts",
+ subcategory: "Line",
+ chunks: []
+ },
+ "chart-line-step": {
+ name: "chart-line-step",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-line-step")),
+ source: "__registry__/default/block/chart-line-step.tsx",
+ files: ["registry/default/block/chart-line-step.tsx"],
+ category: "Charts",
+ subcategory: "Line",
+ chunks: []
+ },
+ "chart-pie-donut-active": {
+ name: "chart-pie-donut-active",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-pie-donut-active")),
+ source: "__registry__/default/block/chart-pie-donut-active.tsx",
+ files: ["registry/default/block/chart-pie-donut-active.tsx"],
+ category: "Charts",
+ subcategory: "Pie",
+ chunks: []
+ },
+ "chart-pie-donut-text": {
+ name: "chart-pie-donut-text",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-pie-donut-text")),
+ source: "__registry__/default/block/chart-pie-donut-text.tsx",
+ files: ["registry/default/block/chart-pie-donut-text.tsx"],
+ category: "Charts",
+ subcategory: "Pie",
+ chunks: []
+ },
+ "chart-pie-donut": {
+ name: "chart-pie-donut",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-pie-donut")),
+ source: "__registry__/default/block/chart-pie-donut.tsx",
+ files: ["registry/default/block/chart-pie-donut.tsx"],
+ category: "Charts",
+ subcategory: "Pie",
+ chunks: []
+ },
+ "chart-pie-interactive": {
+ name: "chart-pie-interactive",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-pie-interactive")),
+ source: "__registry__/default/block/chart-pie-interactive.tsx",
+ files: ["registry/default/block/chart-pie-interactive.tsx"],
+ category: "Charts",
+ subcategory: "Pie",
+ chunks: []
+ },
+ "chart-pie-label-custom": {
+ name: "chart-pie-label-custom",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-pie-label-custom")),
+ source: "__registry__/default/block/chart-pie-label-custom.tsx",
+ files: ["registry/default/block/chart-pie-label-custom.tsx"],
+ category: "Charts",
+ subcategory: "Pie",
+ chunks: []
+ },
+ "chart-pie-label-list": {
+ name: "chart-pie-label-list",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-pie-label-list")),
+ source: "__registry__/default/block/chart-pie-label-list.tsx",
+ files: ["registry/default/block/chart-pie-label-list.tsx"],
+ category: "Charts",
+ subcategory: "Pie",
+ chunks: []
+ },
+ "chart-pie-label": {
+ name: "chart-pie-label",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-pie-label")),
+ source: "__registry__/default/block/chart-pie-label.tsx",
+ files: ["registry/default/block/chart-pie-label.tsx"],
+ category: "Charts",
+ subcategory: "Pie",
+ chunks: []
+ },
+ "chart-pie-legend": {
+ name: "chart-pie-legend",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-pie-legend")),
+ source: "__registry__/default/block/chart-pie-legend.tsx",
+ files: ["registry/default/block/chart-pie-legend.tsx"],
+ category: "Charts",
+ subcategory: "Pie",
+ chunks: []
+ },
+ "chart-pie-separator-none": {
+ name: "chart-pie-separator-none",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-pie-separator-none")),
+ source: "__registry__/default/block/chart-pie-separator-none.tsx",
+ files: ["registry/default/block/chart-pie-separator-none.tsx"],
+ category: "Charts",
+ subcategory: "Pie",
+ chunks: []
+ },
+ "chart-pie-simple": {
+ name: "chart-pie-simple",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-pie-simple")),
+ source: "__registry__/default/block/chart-pie-simple.tsx",
+ files: ["registry/default/block/chart-pie-simple.tsx"],
+ category: "Charts",
+ subcategory: "Pie",
+ chunks: []
+ },
+ "chart-pie-stacked": {
+ name: "chart-pie-stacked",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-pie-stacked")),
+ source: "__registry__/default/block/chart-pie-stacked.tsx",
+ files: ["registry/default/block/chart-pie-stacked.tsx"],
+ category: "Charts",
+ subcategory: "Pie",
+ chunks: []
+ },
+ "chart-radar-default": {
+ name: "chart-radar-default",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radar-default")),
+ source: "__registry__/default/block/chart-radar-default.tsx",
+ files: ["registry/default/block/chart-radar-default.tsx"],
+ category: "Charts",
+ subcategory: "Radar",
+ chunks: []
+ },
+ "chart-radar-dots": {
+ name: "chart-radar-dots",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radar-dots")),
+ source: "__registry__/default/block/chart-radar-dots.tsx",
+ files: ["registry/default/block/chart-radar-dots.tsx"],
+ category: "Charts",
+ subcategory: "Radar",
+ chunks: []
+ },
+ "chart-radar-grid-circle-fill": {
+ name: "chart-radar-grid-circle-fill",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radar-grid-circle-fill")),
+ source: "__registry__/default/block/chart-radar-grid-circle-fill.tsx",
+ files: ["registry/default/block/chart-radar-grid-circle-fill.tsx"],
+ category: "Charts",
+ subcategory: "Radar",
+ chunks: []
+ },
+ "chart-radar-grid-circle-no-lines": {
+ name: "chart-radar-grid-circle-no-lines",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radar-grid-circle-no-lines")),
+ source: "__registry__/default/block/chart-radar-grid-circle-no-lines.tsx",
+ files: ["registry/default/block/chart-radar-grid-circle-no-lines.tsx"],
+ category: "Charts",
+ subcategory: "Radar",
+ chunks: []
+ },
+ "chart-radar-grid-circle": {
+ name: "chart-radar-grid-circle",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radar-grid-circle")),
+ source: "__registry__/default/block/chart-radar-grid-circle.tsx",
+ files: ["registry/default/block/chart-radar-grid-circle.tsx"],
+ category: "Charts",
+ subcategory: "Radar",
+ chunks: []
+ },
+ "chart-radar-grid-custom": {
+ name: "chart-radar-grid-custom",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radar-grid-custom")),
+ source: "__registry__/default/block/chart-radar-grid-custom.tsx",
+ files: ["registry/default/block/chart-radar-grid-custom.tsx"],
+ category: "Charts",
+ subcategory: "Radar",
+ chunks: []
+ },
+ "chart-radar-grid-fill": {
+ name: "chart-radar-grid-fill",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radar-grid-fill")),
+ source: "__registry__/default/block/chart-radar-grid-fill.tsx",
+ files: ["registry/default/block/chart-radar-grid-fill.tsx"],
+ category: "Charts",
+ subcategory: "Radar",
+ chunks: []
+ },
+ "chart-radar-grid-none": {
+ name: "chart-radar-grid-none",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radar-grid-none")),
+ source: "__registry__/default/block/chart-radar-grid-none.tsx",
+ files: ["registry/default/block/chart-radar-grid-none.tsx"],
+ category: "Charts",
+ subcategory: "Radar",
+ chunks: []
+ },
+ "chart-radar-icons": {
+ name: "chart-radar-icons",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radar-icons")),
+ source: "__registry__/default/block/chart-radar-icons.tsx",
+ files: ["registry/default/block/chart-radar-icons.tsx"],
+ category: "Charts",
+ subcategory: "Radar",
+ chunks: []
+ },
+ "chart-radar-label-custom": {
+ name: "chart-radar-label-custom",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radar-label-custom")),
+ source: "__registry__/default/block/chart-radar-label-custom.tsx",
+ files: ["registry/default/block/chart-radar-label-custom.tsx"],
+ category: "Charts",
+ subcategory: "Radar",
+ chunks: []
+ },
+ "chart-radar-legend": {
+ name: "chart-radar-legend",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radar-legend")),
+ source: "__registry__/default/block/chart-radar-legend.tsx",
+ files: ["registry/default/block/chart-radar-legend.tsx"],
+ category: "Charts",
+ subcategory: "Radar",
+ chunks: []
+ },
+ "chart-radar-lines-only": {
+ name: "chart-radar-lines-only",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radar-lines-only")),
+ source: "__registry__/default/block/chart-radar-lines-only.tsx",
+ files: ["registry/default/block/chart-radar-lines-only.tsx"],
+ category: "Charts",
+ subcategory: "Radar",
+ chunks: []
+ },
+ "chart-radar-multiple": {
+ name: "chart-radar-multiple",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radar-multiple")),
+ source: "__registry__/default/block/chart-radar-multiple.tsx",
+ files: ["registry/default/block/chart-radar-multiple.tsx"],
+ category: "Charts",
+ subcategory: "Radar",
+ chunks: []
+ },
+ "chart-radar-radius": {
+ name: "chart-radar-radius",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radar-radius")),
+ source: "__registry__/default/block/chart-radar-radius.tsx",
+ files: ["registry/default/block/chart-radar-radius.tsx"],
+ category: "Charts",
+ subcategory: "Radar",
+ chunks: []
+ },
+ "chart-radial-grid": {
+ name: "chart-radial-grid",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radial-grid")),
+ source: "__registry__/default/block/chart-radial-grid.tsx",
+ files: ["registry/default/block/chart-radial-grid.tsx"],
+ category: "Charts",
+ subcategory: "Radial",
+ chunks: []
+ },
+ "chart-radial-label": {
+ name: "chart-radial-label",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radial-label")),
+ source: "__registry__/default/block/chart-radial-label.tsx",
+ files: ["registry/default/block/chart-radial-label.tsx"],
+ category: "Charts",
+ subcategory: "Radial",
+ chunks: []
+ },
+ "chart-radial-shape": {
+ name: "chart-radial-shape",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radial-shape")),
+ source: "__registry__/default/block/chart-radial-shape.tsx",
+ files: ["registry/default/block/chart-radial-shape.tsx"],
+ category: "Charts",
+ subcategory: "Radial",
+ chunks: []
+ },
+ "chart-radial-simple": {
+ name: "chart-radial-simple",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radial-simple")),
+ source: "__registry__/default/block/chart-radial-simple.tsx",
+ files: ["registry/default/block/chart-radial-simple.tsx"],
+ category: "Charts",
+ subcategory: "Radial",
+ chunks: []
+ },
+ "chart-radial-stacked": {
+ name: "chart-radial-stacked",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radial-stacked")),
+ source: "__registry__/default/block/chart-radial-stacked.tsx",
+ files: ["registry/default/block/chart-radial-stacked.tsx"],
+ category: "Charts",
+ subcategory: "Radial",
+ chunks: []
+ },
+ "chart-radial-text": {
+ name: "chart-radial-text",
+ type: "components:block",
+ registryDependencies: ["card","chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-radial-text")),
+ source: "__registry__/default/block/chart-radial-text.tsx",
+ files: ["registry/default/block/chart-radial-text.tsx"],
+ category: "Charts",
+ subcategory: "Radial",
+ chunks: []
+ },
},
}
diff --git a/apps/design-system/config/docs.ts b/apps/design-system/config/docs.ts
index f2c5ee94b8a..ad2619adf12 100644
--- a/apps/design-system/config/docs.ts
+++ b/apps/design-system/config/docs.ts
@@ -178,6 +178,11 @@ export const docsConfig: DocsConfig = {
href: '/docs/components/carousel',
items: [],
},
+ {
+ title: 'Chart',
+ href: '/docs/components/chart',
+ items: [],
+ },
{
title: 'Checkbox',
href: '/docs/components/checkbox',
diff --git a/apps/design-system/content/docs/components/chart.mdx b/apps/design-system/content/docs/components/chart.mdx
new file mode 100644
index 00000000000..bd7db2867c5
--- /dev/null
+++ b/apps/design-system/content/docs/components/chart.mdx
@@ -0,0 +1,542 @@
+---
+title: Chart
+description: Beautiful charts. Built using Recharts. Copy and paste into your apps.
+component: true
+source:
+ shadcn: true
+---
+
+<ComponentPreview name="chart-bar-interactive" peekCode wide />
+
+Introducing **Charts**. A collection of chart components that you can copy and paste into your apps.
+
+Charts are designed to look great out of the box. They work well with the other components and are fully customizable to fit your project.
+
+[Browse the Charts Library](/charts).
+
+## Component
+
+We use [Recharts](https://recharts.org/) under the hood.
+
+We designed the `chart` component with composition in mind. **You build your charts using Recharts components and only bring in custom components, such as `ChartTootlip`, when and where you need it**.
+
+```tsx showLineNumbers /ChartContainer/ /ChartTooltipContent/
+import { Bar, BarChart } from 'recharts'
+
+import { ChartContainer, ChartTooltipContent } from '@/components/ui/charts'
+
+export function MyChart() {
+ return (
+ <ChartContainer>
+ <BarChart data={data}>
+ <Bar dataKey="value" />
+ <ChartTooltip content={<ChartTooltipContent />} />
+ </BarChart>
+ </ChartContainer>
+ )
+}
+```
+
+We do not wrap Recharts. This means you're not locked into an abstraction. When a new Recharts version is released, you can follow the official upgrade path to upgrade your charts.
+
+**The components are yours**.
+
+## Installation
+
+<Callout className="mt-4">
+
+**Note:** If you are trying to use charts with **React 19** or the **Next.js 15**, you will need the [recharts@alpha](https://github.com/recharts/recharts/releases/tag/v2.13.0-alpha.4) release currently.
+
+</Callout>
+
+Add the following colors to your CSS file in your app.
+
+```css
+@layer base {
+ :root {
+ --chart-1: 12 76% 61%;
+ --chart-2: 173 58% 39%;
+ --chart-3: 197 37% 24%;
+ --chart-4: 43 74% 66%;
+ --chart-5: 27 87% 67%;
+ }
+
+ .dark {
+ --chart-1: 220 70% 50%;
+ --chart-2: 160 60% 45%;
+ --chart-3: 30 80% 55%;
+ --chart-4: 280 65% 60%;
+ --chart-5: 340 75% 55%;
+ }
+}
+```
+
+## Your First Chart
+
+Let's build your first chart. We'll build a bar chart, add a grid, axis, tooltip and legend.
+
+<Steps>
+
+<Step>Start by defining your data</Step>
+
+The following data represents the number of desktop and mobile users for each month.
+
+<Callout className="mt-4">
+
+**Note:** Your data can be in any shape. You are not limited to the shape of the data below. Use the `dataKey` prop to map your data to the chart.
+
+</Callout>
+
+```tsx
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+```
+
+<Step>Define your chart config</Step>
+
+The chart config holds configuration for the chart. This is where you place human-readable strings, such as labels, icons and color tokens for theming.
+
+```tsx
+import { type ChartConfig } from '@/components/ui/chart'
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: '#2563eb',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: '#60a5fa',
+ },
+} satisfies ChartConfig
+```
+
+<Step>Build your chart</Step>
+
+You can now build your chart using Recharts components.
+
+<Callout className="mt-4 bg-amber-50 border-amber-200 dark:bg-amber-950/50 dark:border-amber-950">
+
+**Important:** Remember to set a `min-h-[VALUE]` on the `ChartContainer` component. This is required for the chart be responsive.
+
+</Callout>
+
+<ComponentSource name="chart-bar-demo" />
+
+<ComponentPreview name="chart-bar-demo" className="[&_.preview]:p-4 [&_.preview]:min-h-[250px]" />
+
+</Steps>
+
+### Add a Grid
+
+Let's add a grid to the chart.
+
+<Steps>
+
+<Step>Import the `CartesianGrid` component.</Step>
+
+```tsx /CartesianGrid/
+import { Bar, BarChart, CartesianGrid } from 'recharts'
+```
+
+<Step>Add the `CartesianGrid` component to your chart.</Step>
+
+```tsx showLineNumbers {3}
+<ChartContainer config={chartConfig} className="min-h-[200px] w-full">
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
+ <Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
+ </BarChart>
+</ChartContainer>
+```
+
+<ComponentPreview
+ name="chart-bar-demo-grid"
+ className="[&_.preview]:p-4 [&_.preview]:min-h-[250px]"
+/>
+
+</Steps>
+
+### Add an Axis
+
+To add an x-axis to the chart, we'll use the `XAxis` component.
+
+<Steps>
+
+<Step>Import the `XAxis` component.</Step>
+
+```tsx /XAxis/
+import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
+```
+
+<Step>Add the `XAxis` component to your chart.</Step>
+
+```tsx showLineNumbers {4-10}
+<ChartContainer config={chartConfig} className="h-[200px] w-full">
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
+ <Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
+ </BarChart>
+</ChartContainer>
+```
+
+<ComponentPreview
+ name="chart-bar-demo-axis"
+ className="[&_.preview]:p-4 [&_.preview]:min-h-[250px]"
+/>
+
+</Steps>
+
+### Add Tooltip
+
+So far we've only used components from Recharts. They look great out of the box thanks to some customization in the `chart` component.
+
+To add a tooltip, we'll use the custom `ChartTooltip` and `ChartTooltipContent` components from `chart`.
+
+<Steps>
+
+<Step>Import the `ChartTooltip` and `ChartTooltipContent` components.</Step>
+
+```tsx
+import { ChartTooltip, ChartTooltipContent } from '@/components/ui/chart'
+```
+
+<Step>Add the components to your chart.</Step>
+
+```tsx showLineNumbers {11}
+<ChartContainer config={chartConfig} className="h-[200px] w-full">
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip content={<ChartTooltipContent />} />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
+ <Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
+ </BarChart>
+</ChartContainer>
+```
+
+<ComponentPreview
+ name="chart-bar-demo-tooltip"
+ className="[&_.preview]:p-4 [&_.preview]:min-h-[250px]"
+/>
+
+Hover to see the tooltips. Easy, right? Two components, and we've got a beautiful tooltip.
+
+</Steps>
+
+### Add Legend
+
+We'll do the same for the legend. We'll use the `ChartLegend` and `ChartLegendContent` components from `chart`.
+
+<Steps>
+
+<Step>Import the `ChartLegend` and `ChartLegendContent` components.</Step>
+
+```tsx
+import { ChartLegend, ChartLegendContent } from '@/components/ui/chart'
+```
+
+<Step>Add the components to your chart.</Step>
+
+```tsx showLineNumbers {12}
+<ChartContainer config={chartConfig} className="h-[200px] w-full">
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip content={<ChartTooltipContent />} />
+ <ChartLegend content={<ChartLegendContent />} />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
+ <Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
+ </BarChart>
+</ChartContainer>
+```
+
+<ComponentPreview
+ name="chart-bar-demo-legend"
+ className="[&_.preview]:p-4 [&_.preview]:min-h-[250px]"
+/>
+
+</Steps>
+
+Done. You've built your first chart! What's next?
+
+- [Themes and Colors](/docs/components/chart#theming)
+- [Tooltip](/docs/components/chart#tooltip)
+- [Legend](/docs/components/chart#legend)
+
+## Chart Config
+
+The chart config is where you define the labels, icons and colors for a chart.
+
+It is intentionally decoupled from chart data.
+
+This allows you to share config and color tokens between charts. It can also works independently for cases where your data or color tokens live remotely or in a different format.
+
+```tsx /ChartConfig/
+import { Monitor } from 'lucide-react'
+
+import { type ChartConfig } from '@/components/ui/chart'
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ icon: Monitor,
+ // A color like 'hsl(220, 98%, 61%)' or 'var(--color-name)'
+ color: '#2563eb',
+ // OR a theme object with 'light' and 'dark' keys
+ theme: {
+ light: '#2563eb',
+ dark: '#dc2626',
+ },
+ },
+} satisfies ChartConfig
+```
+
+## Theming
+
+Charts has built-in support for theming. You can use css variables (recommended) or color values in any color format, such as hex, hsl or oklch.
+
+### CSS Variables
+
+<Steps>
+
+<Step>Define your colors in your css file</Step>
+
+```css {6-7,14-15} title="globals.css"
+@layer base {
+ :root {
+ --background: 0 0% 100%;
+ --foreground: 240 10% 3.9%;
+ // ...
+ --chart-1: 12 76% 61%;
+ --chart-2: 173 58% 39%;
+ }
+
+ .dark: {
+ --background: 240 10% 3.9%;
+ --foreground: 0 0% 100%;
+ // ...
+ --chart-1: 220 70% 50%;
+ --chart-2: 160 60% 45%;
+ }
+}
+```
+
+<Step>Add the color to your `chartConfig`</Step>
+
+```tsx {4,8}
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+```
+
+<Callout className="mt-4">
+
+We're wrapping the value in `hsl()` here because we define the colors without color space function.
+
+This is not required. You can use full color values, such as hex, hsl or oklch.
+
+```css
+--chart-1: oklch(70% 0.227 154.59);
+```
+
+```tsx
+color: "var(--chart-1)",
+```
+
+</Callout>
+
+</Steps>
+
+### hex, hsl or oklch
+
+You can also define your colors directly in the chart config. Use the color format you prefer.
+
+```tsx
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: '#2563eb',
+ },
+} satisfies ChartConfig
+```
+
+### Using Colors
+
+To use the theme colors in your chart, reference the colors using the format `var(--color-KEY)`.
+
+#### Components
+
+```tsx
+<Bar dataKey="desktop" fill="var(--color-desktop)" />
+```
+
+#### Chart Data
+
+```tsx
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+]
+```
+
+#### Tailwind
+
+```tsx
+<LabelList className="fill-[--color-desktop]" />
+```
+
+## Tooltip
+
+A chart tooltip contains a label, name, indicator and value. You can use a combination of these to customize your tooltip.
+
+<ComponentPreview name="chart-tooltip-demo" className="[&_.preview]:py-0" hideCode />
+
+You can turn on/off any of these using the `hideLabel`, `hideIndicator` props and customize the indicator style using the `indicator` prop.
+
+Use `labelKey` and `nameKey` to use a custom key for the tooltip label and name.
+
+Chart comes with the `<ChartTooltip>` and `<ChartTooltipContent>` components. You can use these two components to add custom tooltips to your chart.
+
+```tsx
+import { ChartTooltip, ChartTooltipContent } from '@/components/ui/chart'
+```
+
+```tsx
+<ChartTooltip content={<ChartTooltipContent />} />
+```
+
+### Props
+
+Use the following props to customize the tooltip.
+
+| Prop | Type | Description |
+| :-------------- | :----------------------- | :------------------------------------------- |
+| `labelKey` | string | The config or data key to use for the label. |
+| `nameKey` | string | The config or data key to use for the name. |
+| `indicator` | `dot` `line` or `dashed` | The indicator style for the tooltip. |
+| `hideLabel` | boolean | Whether to hide the label. |
+| `hideIndicator` | boolean | Whether to hide the indicator. |
+
+### Colors
+
+Colors are automatically referenced from the chart config.
+
+### Custom
+
+To use a custom key for tooltip label and names, use the `labelKey` and `nameKey` props.
+
+```tsx /browser/
+const chartData = [
+ { browser: 'chrome', visitors: 187, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Total Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+```
+
+```tsx
+<ChartTooltip content={<ChartTooltipContent labelKey="visitors" nameKey="browser" />} />
+```
+
+This will use `Total Visitors` for label and `Chrome` and `Safari` for the tooltip names.
+
+## Legend
+
+You can use the custom `<ChartLegend>` and `<ChartLegendContent>` components to add a legend to your chart.
+
+```tsx
+import { ChartLegend, ChartLegendContent } from '@/components/ui/chart'
+```
+
+```tsx
+<ChartLegend content={<ChartLegendContent />} />
+```
+
+### Colors
+
+Colors are automatically referenced from the chart config.
+
+### Custom
+
+To use a custom key for legend names, use the `nameKey` prop.
+
+```tsx /browser/
+const chartData = [
+ { browser: 'chrome', visitors: 187, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+]
+
+const chartConfig = {
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+```
+
+```tsx
+<ChartLegend content={<ChartLegendContent nameKey="browser" />} />
+```
+
+This will use `Chrome` and `Safari` for the legend names.
+
+## Accessibility
+
+You can turn on the `accessibilityLayer` prop to add an accessible layer to your chart.
+
+This prop adds keyboard access and screen reader support to your charts.
+
+```tsx
+<LineChart accessibilityLayer />
+```
diff --git a/apps/design-system/registry/charts.ts b/apps/design-system/registry/charts.ts
new file mode 100644
index 00000000000..be6ab4c2b48
--- /dev/null
+++ b/apps/design-system/registry/charts.ts
@@ -0,0 +1,503 @@
+import { Registry } from './schema'
+
+export const charts: Registry = [
+ // Area Charts
+ {
+ name: 'chart-area-axes',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-area-axes.tsx'],
+ category: 'Charts',
+ subcategory: 'Area',
+ },
+ {
+ name: 'chart-area-default',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-area-default.tsx'],
+ category: 'Charts',
+ subcategory: 'Area',
+ },
+ {
+ name: 'chart-area-gradient',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-area-gradient.tsx'],
+ category: 'Charts',
+ subcategory: 'Area',
+ },
+ {
+ name: 'chart-area-icons',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-area-icons.tsx'],
+ category: 'Charts',
+ subcategory: 'Area',
+ },
+ {
+ name: 'chart-area-interactive',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-area-interactive.tsx'],
+ category: 'Charts',
+ subcategory: 'Area',
+ },
+ {
+ name: 'chart-area-legend',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-area-legend.tsx'],
+ category: 'Charts',
+ subcategory: 'Area',
+ },
+ {
+ name: 'chart-area-linear',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-area-linear.tsx'],
+ category: 'Charts',
+ subcategory: 'Area',
+ },
+ {
+ name: 'chart-area-stacked-expand',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-area-stacked-expand.tsx'],
+ category: 'Charts',
+ subcategory: 'Area',
+ },
+ {
+ name: 'chart-area-stacked',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-area-stacked.tsx'],
+ category: 'Charts',
+ subcategory: 'Area',
+ },
+ {
+ name: 'chart-area-step',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-area-step.tsx'],
+ category: 'Charts',
+ subcategory: 'Area',
+ },
+
+ // Bar Charts
+ {
+ name: 'chart-bar-active',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-bar-active.tsx'],
+ category: 'Charts',
+ subcategory: 'Bar',
+ },
+ {
+ name: 'chart-bar-default',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-bar-default.tsx'],
+ category: 'Charts',
+ subcategory: 'Bar',
+ },
+ {
+ name: 'chart-bar-horizontal',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-bar-horizontal.tsx'],
+ category: 'Charts',
+ subcategory: 'Bar',
+ },
+ {
+ name: 'chart-bar-interactive',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-bar-interactive.tsx'],
+ category: 'Charts',
+ subcategory: 'Bar',
+ },
+ {
+ name: 'chart-bar-label-custom',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-bar-label-custom.tsx'],
+ category: 'Charts',
+ subcategory: 'Bar',
+ },
+ {
+ name: 'chart-bar-label',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-bar-label.tsx'],
+ category: 'Charts',
+ subcategory: 'Bar',
+ },
+ {
+ name: 'chart-bar-mixed',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-bar-mixed.tsx'],
+ category: 'Charts',
+ subcategory: 'Bar',
+ },
+ {
+ name: 'chart-bar-multiple',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-bar-multiple.tsx'],
+ category: 'Charts',
+ subcategory: 'Bar',
+ },
+ {
+ name: 'chart-bar-negative',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-bar-negative.tsx'],
+ category: 'Charts',
+ subcategory: 'Bar',
+ },
+ {
+ name: 'chart-bar-stacked',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-bar-stacked.tsx'],
+ category: 'Charts',
+ subcategory: 'Bar',
+ },
+
+ // Line Charts
+ {
+ name: 'chart-line-default',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-line-default.tsx'],
+ category: 'Charts',
+ subcategory: 'Line',
+ },
+ {
+ name: 'chart-line-dots-colors',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-line-dots-colors.tsx'],
+ category: 'Charts',
+ subcategory: 'Line',
+ },
+ {
+ name: 'chart-line-dots-custom',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-line-dots-custom.tsx'],
+ category: 'Charts',
+ subcategory: 'Line',
+ },
+ {
+ name: 'chart-line-dots',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-line-dots.tsx'],
+ category: 'Charts',
+ subcategory: 'Line',
+ },
+ {
+ name: 'chart-line-interactive',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-line-interactive.tsx'],
+ category: 'Charts',
+ subcategory: 'Line',
+ },
+ {
+ name: 'chart-line-label-custom',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-line-label-custom.tsx'],
+ category: 'Charts',
+ subcategory: 'Line',
+ },
+ {
+ name: 'chart-line-label',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-line-label.tsx'],
+ category: 'Charts',
+ subcategory: 'Line',
+ },
+ {
+ name: 'chart-line-linear',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-line-linear.tsx'],
+ category: 'Charts',
+ subcategory: 'Line',
+ },
+ {
+ name: 'chart-line-multiple',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-line-multiple.tsx'],
+ category: 'Charts',
+ subcategory: 'Line',
+ },
+ {
+ name: 'chart-line-step',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-line-step.tsx'],
+ category: 'Charts',
+ subcategory: 'Line',
+ },
+
+ // Pie Charts
+ {
+ name: 'chart-pie-donut-active',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-pie-donut-active.tsx'],
+ category: 'Charts',
+ subcategory: 'Pie',
+ },
+ {
+ name: 'chart-pie-donut-text',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-pie-donut-text.tsx'],
+ category: 'Charts',
+ subcategory: 'Pie',
+ },
+ {
+ name: 'chart-pie-donut',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-pie-donut.tsx'],
+ category: 'Charts',
+ subcategory: 'Pie',
+ },
+ {
+ name: 'chart-pie-interactive',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-pie-interactive.tsx'],
+ category: 'Charts',
+ subcategory: 'Pie',
+ },
+ {
+ name: 'chart-pie-label-custom',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-pie-label-custom.tsx'],
+ category: 'Charts',
+ subcategory: 'Pie',
+ },
+ {
+ name: 'chart-pie-label-list',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-pie-label-list.tsx'],
+ category: 'Charts',
+ subcategory: 'Pie',
+ },
+ {
+ name: 'chart-pie-label',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-pie-label.tsx'],
+ category: 'Charts',
+ subcategory: 'Pie',
+ },
+ {
+ name: 'chart-pie-legend',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-pie-legend.tsx'],
+ category: 'Charts',
+ subcategory: 'Pie',
+ },
+ {
+ name: 'chart-pie-separator-none',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-pie-separator-none.tsx'],
+ category: 'Charts',
+ subcategory: 'Pie',
+ },
+ {
+ name: 'chart-pie-simple',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-pie-simple.tsx'],
+ category: 'Charts',
+ subcategory: 'Pie',
+ },
+ {
+ name: 'chart-pie-stacked',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-pie-stacked.tsx'],
+ category: 'Charts',
+ subcategory: 'Pie',
+ },
+
+ // Radar Charts
+ {
+ name: 'chart-radar-default',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radar-default.tsx'],
+ category: 'Charts',
+ subcategory: 'Radar',
+ },
+ {
+ name: 'chart-radar-dots',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radar-dots.tsx'],
+ category: 'Charts',
+ subcategory: 'Radar',
+ },
+ {
+ name: 'chart-radar-grid-circle-fill',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radar-grid-circle-fill.tsx'],
+ category: 'Charts',
+ subcategory: 'Radar',
+ },
+ {
+ name: 'chart-radar-grid-circle-no-lines',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radar-grid-circle-no-lines.tsx'],
+ category: 'Charts',
+ subcategory: 'Radar',
+ },
+ {
+ name: 'chart-radar-grid-circle',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radar-grid-circle.tsx'],
+ category: 'Charts',
+ subcategory: 'Radar',
+ },
+ {
+ name: 'chart-radar-grid-custom',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radar-grid-custom.tsx'],
+ category: 'Charts',
+ subcategory: 'Radar',
+ },
+ {
+ name: 'chart-radar-grid-fill',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radar-grid-fill.tsx'],
+ category: 'Charts',
+ subcategory: 'Radar',
+ },
+ {
+ name: 'chart-radar-grid-none',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radar-grid-none.tsx'],
+ category: 'Charts',
+ subcategory: 'Radar',
+ },
+ {
+ name: 'chart-radar-icons',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radar-icons.tsx'],
+ category: 'Charts',
+ subcategory: 'Radar',
+ },
+ {
+ name: 'chart-radar-label-custom',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radar-label-custom.tsx'],
+ category: 'Charts',
+ subcategory: 'Radar',
+ },
+ {
+ name: 'chart-radar-legend',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radar-legend.tsx'],
+ category: 'Charts',
+ subcategory: 'Radar',
+ },
+ {
+ name: 'chart-radar-lines-only',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radar-lines-only.tsx'],
+ category: 'Charts',
+ subcategory: 'Radar',
+ },
+ {
+ name: 'chart-radar-multiple',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radar-multiple.tsx'],
+ category: 'Charts',
+ subcategory: 'Radar',
+ },
+ {
+ name: 'chart-radar-radius',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radar-radius.tsx'],
+ category: 'Charts',
+ subcategory: 'Radar',
+ },
+
+ // Radial Charts
+ {
+ name: 'chart-radial-grid',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radial-grid.tsx'],
+ category: 'Charts',
+ subcategory: 'Radial',
+ },
+ {
+ name: 'chart-radial-label',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radial-label.tsx'],
+ category: 'Charts',
+ subcategory: 'Radial',
+ },
+ {
+ name: 'chart-radial-shape',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radial-shape.tsx'],
+ category: 'Charts',
+ subcategory: 'Radial',
+ },
+ {
+ name: 'chart-radial-simple',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radial-simple.tsx'],
+ category: 'Charts',
+ subcategory: 'Radial',
+ },
+ {
+ name: 'chart-radial-stacked',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radial-stacked.tsx'],
+ category: 'Charts',
+ subcategory: 'Radial',
+ },
+ {
+ name: 'chart-radial-text',
+ type: 'components:block',
+ registryDependencies: ['card', 'chart'],
+ files: ['block/chart-radial-text.tsx'],
+ category: 'Charts',
+ subcategory: 'Radial',
+ },
+]
diff --git a/apps/design-system/registry/default/block/chart-area-axes.tsx b/apps/design-system/registry/default/block/chart-area-axes.tsx
new file mode 100644
index 00000000000..26713267cbd
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-area-axes.tsx
@@ -0,0 +1,91 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis, YAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'An area chart with axes'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Axes</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: -20,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <YAxis tickLine={false} axisLine={false} tickMargin={8} tickCount={3} />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
+ <Area
+ dataKey="mobile"
+ type="natural"
+ fill="var(--color-mobile)"
+ fillOpacity={0.4}
+ stroke="var(--color-mobile)"
+ stackId="a"
+ />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ stackId="a"
+ />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-area-default.tsx b/apps/design-system/registry/default/block/chart-area-default.tsx
new file mode 100644
index 00000000000..0ccfe016d7c
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-area-default.tsx
@@ -0,0 +1,77 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A simple area chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-area-gradient.tsx b/apps/design-system/registry/default/block/chart-area-gradient.tsx
new file mode 100644
index 00000000000..d6e7ad9b621
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-area-gradient.tsx
@@ -0,0 +1,100 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'An area chart with gradient fill'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Gradient</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
+ <defs>
+ <linearGradient id="fillDesktop" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor="var(--color-desktop)" stopOpacity={0.8} />
+ <stop offset="95%" stopColor="var(--color-desktop)" stopOpacity={0.1} />
+ </linearGradient>
+ <linearGradient id="fillMobile" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor="var(--color-mobile)" stopOpacity={0.8} />
+ <stop offset="95%" stopColor="var(--color-mobile)" stopOpacity={0.1} />
+ </linearGradient>
+ </defs>
+ <Area
+ dataKey="mobile"
+ type="natural"
+ fill="url(#fillMobile)"
+ fillOpacity={0.4}
+ stroke="var(--color-mobile)"
+ stackId="a"
+ />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="url(#fillDesktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ stackId="a"
+ />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-area-icons.tsx b/apps/design-system/registry/default/block/chart-area-icons.tsx
new file mode 100644
index 00000000000..bc9d0195253
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-area-icons.tsx
@@ -0,0 +1,100 @@
+'use client'
+
+import { TrendingDown, TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import {
+ ChartConfig,
+ ChartContainer,
+ ChartLegend,
+ ChartLegendContent,
+ ChartTooltip,
+ ChartTooltipContent,
+} from 'ui'
+
+export const description = 'An area chart with icons'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ icon: TrendingDown,
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ icon: TrendingUp,
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Icons</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <Area
+ dataKey="mobile"
+ type="natural"
+ fill="var(--color-mobile)"
+ fillOpacity={0.4}
+ stroke="var(--color-mobile)"
+ stackId="a"
+ />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ stackId="a"
+ />
+ <ChartLegend content={<ChartLegendContent />} />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-area-interactive.tsx b/apps/design-system/registry/default/block/chart-area-interactive.tsx
new file mode 100644
index 00000000000..df2579fe8f8
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-area-interactive.tsx
@@ -0,0 +1,238 @@
+'use client'
+
+import * as React from 'react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
+import {
+ ChartConfig,
+ ChartContainer,
+ ChartLegend,
+ ChartLegendContent,
+ ChartTooltip,
+ ChartTooltipContent,
+} from 'ui'
+import {
+ Select_Shadcn_,
+ SelectContent_Shadcn_,
+ SelectItem_Shadcn_,
+ SelectTrigger_Shadcn_,
+ SelectValue_Shadcn_,
+} from 'ui'
+
+export const description = 'An interactive area chart'
+
+const chartData = [
+ { date: '2024-04-01', desktop: 222, mobile: 150 },
+ { date: '2024-04-02', desktop: 97, mobile: 180 },
+ { date: '2024-04-03', desktop: 167, mobile: 120 },
+ { date: '2024-04-04', desktop: 242, mobile: 260 },
+ { date: '2024-04-05', desktop: 373, mobile: 290 },
+ { date: '2024-04-06', desktop: 301, mobile: 340 },
+ { date: '2024-04-07', desktop: 245, mobile: 180 },
+ { date: '2024-04-08', desktop: 409, mobile: 320 },
+ { date: '2024-04-09', desktop: 59, mobile: 110 },
+ { date: '2024-04-10', desktop: 261, mobile: 190 },
+ { date: '2024-04-11', desktop: 327, mobile: 350 },
+ { date: '2024-04-12', desktop: 292, mobile: 210 },
+ { date: '2024-04-13', desktop: 342, mobile: 380 },
+ { date: '2024-04-14', desktop: 137, mobile: 220 },
+ { date: '2024-04-15', desktop: 120, mobile: 170 },
+ { date: '2024-04-16', desktop: 138, mobile: 190 },
+ { date: '2024-04-17', desktop: 446, mobile: 360 },
+ { date: '2024-04-18', desktop: 364, mobile: 410 },
+ { date: '2024-04-19', desktop: 243, mobile: 180 },
+ { date: '2024-04-20', desktop: 89, mobile: 150 },
+ { date: '2024-04-21', desktop: 137, mobile: 200 },
+ { date: '2024-04-22', desktop: 224, mobile: 170 },
+ { date: '2024-04-23', desktop: 138, mobile: 230 },
+ { date: '2024-04-24', desktop: 387, mobile: 290 },
+ { date: '2024-04-25', desktop: 215, mobile: 250 },
+ { date: '2024-04-26', desktop: 75, mobile: 130 },
+ { date: '2024-04-27', desktop: 383, mobile: 420 },
+ { date: '2024-04-28', desktop: 122, mobile: 180 },
+ { date: '2024-04-29', desktop: 315, mobile: 240 },
+ { date: '2024-04-30', desktop: 454, mobile: 380 },
+ { date: '2024-05-01', desktop: 165, mobile: 220 },
+ { date: '2024-05-02', desktop: 293, mobile: 310 },
+ { date: '2024-05-03', desktop: 247, mobile: 190 },
+ { date: '2024-05-04', desktop: 385, mobile: 420 },
+ { date: '2024-05-05', desktop: 481, mobile: 390 },
+ { date: '2024-05-06', desktop: 498, mobile: 520 },
+ { date: '2024-05-07', desktop: 388, mobile: 300 },
+ { date: '2024-05-08', desktop: 149, mobile: 210 },
+ { date: '2024-05-09', desktop: 227, mobile: 180 },
+ { date: '2024-05-10', desktop: 293, mobile: 330 },
+ { date: '2024-05-11', desktop: 335, mobile: 270 },
+ { date: '2024-05-12', desktop: 197, mobile: 240 },
+ { date: '2024-05-13', desktop: 197, mobile: 160 },
+ { date: '2024-05-14', desktop: 448, mobile: 490 },
+ { date: '2024-05-15', desktop: 473, mobile: 380 },
+ { date: '2024-05-16', desktop: 338, mobile: 400 },
+ { date: '2024-05-17', desktop: 499, mobile: 420 },
+ { date: '2024-05-18', desktop: 315, mobile: 350 },
+ { date: '2024-05-19', desktop: 235, mobile: 180 },
+ { date: '2024-05-20', desktop: 177, mobile: 230 },
+ { date: '2024-05-21', desktop: 82, mobile: 140 },
+ { date: '2024-05-22', desktop: 81, mobile: 120 },
+ { date: '2024-05-23', desktop: 252, mobile: 290 },
+ { date: '2024-05-24', desktop: 294, mobile: 220 },
+ { date: '2024-05-25', desktop: 201, mobile: 250 },
+ { date: '2024-05-26', desktop: 213, mobile: 170 },
+ { date: '2024-05-27', desktop: 420, mobile: 460 },
+ { date: '2024-05-28', desktop: 233, mobile: 190 },
+ { date: '2024-05-29', desktop: 78, mobile: 130 },
+ { date: '2024-05-30', desktop: 340, mobile: 280 },
+ { date: '2024-05-31', desktop: 178, mobile: 230 },
+ { date: '2024-06-01', desktop: 178, mobile: 200 },
+ { date: '2024-06-02', desktop: 470, mobile: 410 },
+ { date: '2024-06-03', desktop: 103, mobile: 160 },
+ { date: '2024-06-04', desktop: 439, mobile: 380 },
+ { date: '2024-06-05', desktop: 88, mobile: 140 },
+ { date: '2024-06-06', desktop: 294, mobile: 250 },
+ { date: '2024-06-07', desktop: 323, mobile: 370 },
+ { date: '2024-06-08', desktop: 385, mobile: 320 },
+ { date: '2024-06-09', desktop: 438, mobile: 480 },
+ { date: '2024-06-10', desktop: 155, mobile: 200 },
+ { date: '2024-06-11', desktop: 92, mobile: 150 },
+ { date: '2024-06-12', desktop: 492, mobile: 420 },
+ { date: '2024-06-13', desktop: 81, mobile: 130 },
+ { date: '2024-06-14', desktop: 426, mobile: 380 },
+ { date: '2024-06-15', desktop: 307, mobile: 350 },
+ { date: '2024-06-16', desktop: 371, mobile: 310 },
+ { date: '2024-06-17', desktop: 475, mobile: 520 },
+ { date: '2024-06-18', desktop: 107, mobile: 170 },
+ { date: '2024-06-19', desktop: 341, mobile: 290 },
+ { date: '2024-06-20', desktop: 408, mobile: 450 },
+ { date: '2024-06-21', desktop: 169, mobile: 210 },
+ { date: '2024-06-22', desktop: 317, mobile: 270 },
+ { date: '2024-06-23', desktop: 480, mobile: 530 },
+ { date: '2024-06-24', desktop: 132, mobile: 180 },
+ { date: '2024-06-25', desktop: 141, mobile: 190 },
+ { date: '2024-06-26', desktop: 434, mobile: 380 },
+ { date: '2024-06-27', desktop: 448, mobile: 490 },
+ { date: '2024-06-28', desktop: 149, mobile: 200 },
+ { date: '2024-06-29', desktop: 103, mobile: 160 },
+ { date: '2024-06-30', desktop: 446, mobile: 400 },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ const [timeRange, setTimeRange] = React.useState('90d')
+
+ const filteredData = chartData.filter((item) => {
+ const date = new Date(item.date)
+ const now = new Date()
+ let daysToSubtract = 90
+ if (timeRange === '30d') {
+ daysToSubtract = 30
+ } else if (timeRange === '7d') {
+ daysToSubtract = 7
+ }
+ now.setDate(now.getDate() - daysToSubtract)
+ return date >= now
+ })
+
+ return (
+ <Card>
+ <CardHeader className="flex items-center gap-2 space-y-0 border-b py-5 sm:flex-row">
+ <div className="grid flex-1 gap-1 text-center sm:text-left">
+ <CardTitle>Area Chart - Interactive</CardTitle>
+ <CardDescription>Showing total visitors for the last 3 months</CardDescription>
+ </div>
+ <Select_Shadcn_ value={timeRange} onValueChange={setTimeRange}>
+ <SelectTrigger_Shadcn_
+ className="w-[160px] rounded-lg sm:ml-auto"
+ aria-label="Select a value"
+ >
+ <SelectValue_Shadcn_ placeholder="Last 3 months" />
+ </SelectTrigger_Shadcn_>
+ <SelectContent_Shadcn_ className="rounded-xl">
+ <SelectItem_Shadcn_ value="90d" className="rounded-lg">
+ Last 3 months
+ </SelectItem_Shadcn_>
+ <SelectItem_Shadcn_ value="30d" className="rounded-lg">
+ Last 30 days
+ </SelectItem_Shadcn_>
+ <SelectItem_Shadcn_ value="7d" className="rounded-lg">
+ Last 7 days
+ </SelectItem_Shadcn_>
+ </SelectContent_Shadcn_>
+ </Select_Shadcn_>
+ </CardHeader>
+ <CardContent className="px-2 pt-4 sm:px-6 sm:pt-6">
+ <ChartContainer config={chartConfig} className="aspect-auto h-[250px] w-full">
+ <AreaChart data={filteredData}>
+ <defs>
+ <linearGradient id="fillDesktop" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor="var(--color-desktop)" stopOpacity={0.8} />
+ <stop offset="95%" stopColor="var(--color-desktop)" stopOpacity={0.1} />
+ </linearGradient>
+ <linearGradient id="fillMobile" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor="var(--color-mobile)" stopOpacity={0.8} />
+ <stop offset="95%" stopColor="var(--color-mobile)" stopOpacity={0.1} />
+ </linearGradient>
+ </defs>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="date"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ minTickGap={32}
+ tickFormatter={(value) => {
+ const date = new Date(value)
+ return date.toLocaleDateString('en-US', {
+ month: 'short',
+ day: 'numeric',
+ })
+ }}
+ />
+ <ChartTooltip
+ cursor={false}
+ content={
+ <ChartTooltipContent
+ labelFormatter={(value) => {
+ return new Date(value).toLocaleDateString('en-US', {
+ month: 'short',
+ day: 'numeric',
+ })
+ }}
+ indicator="dot"
+ />
+ }
+ />
+ <Area
+ dataKey="mobile"
+ type="natural"
+ fill="url(#fillMobile)"
+ stroke="var(--color-mobile)"
+ stackId="a"
+ />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="url(#fillDesktop)"
+ stroke="var(--color-desktop)"
+ stackId="a"
+ />
+ <ChartLegend content={<ChartLegendContent />} />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-area-legend.tsx b/apps/design-system/registry/default/block/chart-area-legend.tsx
new file mode 100644
index 00000000000..a58cfa9fbd9
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-area-legend.tsx
@@ -0,0 +1,98 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import {
+ ChartConfig,
+ ChartContainer,
+ ChartLegend,
+ ChartLegendContent,
+ ChartTooltip,
+ ChartTooltipContent,
+} from 'ui'
+
+export const description = 'An area chart with a legend'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Legend</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <Area
+ dataKey="mobile"
+ type="natural"
+ fill="var(--color-mobile)"
+ fillOpacity={0.4}
+ stroke="var(--color-mobile)"
+ stackId="a"
+ />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ stackId="a"
+ />
+ <ChartLegend content={<ChartLegendContent />} />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-area-linear.tsx b/apps/design-system/registry/default/block/chart-area-linear.tsx
new file mode 100644
index 00000000000..8381711c7aa
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-area-linear.tsx
@@ -0,0 +1,80 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A linear area chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Linear</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent indicator="dot" hideLabel />}
+ />
+ <Area
+ dataKey="desktop"
+ type="linear"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-area-stacked-expand.tsx b/apps/design-system/registry/default/block/chart-area-stacked-expand.tsx
new file mode 100644
index 00000000000..eca0b1118f7
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-area-stacked-expand.tsx
@@ -0,0 +1,104 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A stacked area chart with expand stacking'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80, other: 45 },
+ { month: 'February', desktop: 305, mobile: 200, other: 100 },
+ { month: 'March', desktop: 237, mobile: 120, other: 150 },
+ { month: 'April', desktop: 73, mobile: 190, other: 50 },
+ { month: 'May', desktop: 209, mobile: 130, other: 100 },
+ { month: 'June', desktop: 214, mobile: 140, other: 160 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-3))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Stacked Expanded</CardTitle>
+ <CardDescription>Showing total visitors for the last 6months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ top: 12,
+ }}
+ stackOffset="expand"
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <Area
+ dataKey="other"
+ type="natural"
+ fill="var(--color-other)"
+ fillOpacity={0.1}
+ stroke="var(--color-other)"
+ stackId="a"
+ />
+ <Area
+ dataKey="mobile"
+ type="natural"
+ fill="var(--color-mobile)"
+ fillOpacity={0.4}
+ stroke="var(--color-mobile)"
+ stackId="a"
+ />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ stackId="a"
+ />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-area-stacked.tsx b/apps/design-system/registry/default/block/chart-area-stacked.tsx
new file mode 100644
index 00000000000..22c0f58558b
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-area-stacked.tsx
@@ -0,0 +1,90 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A stacked area chart'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Stacked</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="dot" />} />
+ <Area
+ dataKey="mobile"
+ type="natural"
+ fill="var(--color-mobile)"
+ fillOpacity={0.4}
+ stroke="var(--color-mobile)"
+ stackId="a"
+ />
+ <Area
+ dataKey="desktop"
+ type="natural"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ stackId="a"
+ />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-area-step.tsx b/apps/design-system/registry/default/block/chart-area-step.tsx
new file mode 100644
index 00000000000..5ac732aeaf4
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-area-step.tsx
@@ -0,0 +1,78 @@
+'use client'
+
+import { Activity, TrendingUp } from 'lucide-react'
+import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A step area chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ icon: Activity,
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Area Chart - Step</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <AreaChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Area
+ dataKey="desktop"
+ type="step"
+ fill="var(--color-desktop)"
+ fillOpacity={0.4}
+ stroke="var(--color-desktop)"
+ />
+ </AreaChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-bar-active.tsx b/apps/design-system/registry/default/block/chart-bar-active.tsx
new file mode 100644
index 00000000000..b1ab1d95e1a
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-bar-active.tsx
@@ -0,0 +1,94 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, CartesianGrid, Rectangle, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A bar chart with an active bar'
+
+const chartData = [
+ { browser: 'chrome', visitors: 187, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 275, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Active</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="browser"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => chartConfig[value as keyof typeof chartConfig]?.label}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Bar
+ dataKey="visitors"
+ strokeWidth={2}
+ radius={8}
+ activeIndex={2}
+ activeBar={({ ...props }) => {
+ return (
+ <Rectangle
+ {...props}
+ fillOpacity={0.8}
+ stroke={props.payload.fill}
+ strokeDasharray={4}
+ strokeDashoffset={4}
+ />
+ )
+ }}
+ />
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-bar-default.tsx b/apps/design-system/registry/default/block/chart-bar-default.tsx
new file mode 100644
index 00000000000..1c0596e3b57
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-bar-default.tsx
@@ -0,0 +1,60 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A bar chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={8} />
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-bar-horizontal.tsx b/apps/design-system/registry/default/block/chart-bar-horizontal.tsx
new file mode 100644
index 00000000000..2305d0a4e1c
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-bar-horizontal.tsx
@@ -0,0 +1,68 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, XAxis, YAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A horizontal bar chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Horizontal</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart
+ accessibilityLayer
+ data={chartData}
+ layout="vertical"
+ margin={{
+ left: -20,
+ }}
+ >
+ <XAxis type="number" dataKey="desktop" hide />
+ <YAxis
+ dataKey="month"
+ type="category"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={5} />
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-bar-interactive.tsx b/apps/design-system/registry/default/block/chart-bar-interactive.tsx
new file mode 100644
index 00000000000..34374419f59
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-bar-interactive.tsx
@@ -0,0 +1,202 @@
+'use client'
+
+import * as React from 'react'
+import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'An interactive bar chart'
+
+const chartData = [
+ { date: '2024-04-01', desktop: 222, mobile: 150 },
+ { date: '2024-04-02', desktop: 97, mobile: 180 },
+ { date: '2024-04-03', desktop: 167, mobile: 120 },
+ { date: '2024-04-04', desktop: 242, mobile: 260 },
+ { date: '2024-04-05', desktop: 373, mobile: 290 },
+ { date: '2024-04-06', desktop: 301, mobile: 340 },
+ { date: '2024-04-07', desktop: 245, mobile: 180 },
+ { date: '2024-04-08', desktop: 409, mobile: 320 },
+ { date: '2024-04-09', desktop: 59, mobile: 110 },
+ { date: '2024-04-10', desktop: 261, mobile: 190 },
+ { date: '2024-04-11', desktop: 327, mobile: 350 },
+ { date: '2024-04-12', desktop: 292, mobile: 210 },
+ { date: '2024-04-13', desktop: 342, mobile: 380 },
+ { date: '2024-04-14', desktop: 137, mobile: 220 },
+ { date: '2024-04-15', desktop: 120, mobile: 170 },
+ { date: '2024-04-16', desktop: 138, mobile: 190 },
+ { date: '2024-04-17', desktop: 446, mobile: 360 },
+ { date: '2024-04-18', desktop: 364, mobile: 410 },
+ { date: '2024-04-19', desktop: 243, mobile: 180 },
+ { date: '2024-04-20', desktop: 89, mobile: 150 },
+ { date: '2024-04-21', desktop: 137, mobile: 200 },
+ { date: '2024-04-22', desktop: 224, mobile: 170 },
+ { date: '2024-04-23', desktop: 138, mobile: 230 },
+ { date: '2024-04-24', desktop: 387, mobile: 290 },
+ { date: '2024-04-25', desktop: 215, mobile: 250 },
+ { date: '2024-04-26', desktop: 75, mobile: 130 },
+ { date: '2024-04-27', desktop: 383, mobile: 420 },
+ { date: '2024-04-28', desktop: 122, mobile: 180 },
+ { date: '2024-04-29', desktop: 315, mobile: 240 },
+ { date: '2024-04-30', desktop: 454, mobile: 380 },
+ { date: '2024-05-01', desktop: 165, mobile: 220 },
+ { date: '2024-05-02', desktop: 293, mobile: 310 },
+ { date: '2024-05-03', desktop: 247, mobile: 190 },
+ { date: '2024-05-04', desktop: 385, mobile: 420 },
+ { date: '2024-05-05', desktop: 481, mobile: 390 },
+ { date: '2024-05-06', desktop: 498, mobile: 520 },
+ { date: '2024-05-07', desktop: 388, mobile: 300 },
+ { date: '2024-05-08', desktop: 149, mobile: 210 },
+ { date: '2024-05-09', desktop: 227, mobile: 180 },
+ { date: '2024-05-10', desktop: 293, mobile: 330 },
+ { date: '2024-05-11', desktop: 335, mobile: 270 },
+ { date: '2024-05-12', desktop: 197, mobile: 240 },
+ { date: '2024-05-13', desktop: 197, mobile: 160 },
+ { date: '2024-05-14', desktop: 448, mobile: 490 },
+ { date: '2024-05-15', desktop: 473, mobile: 380 },
+ { date: '2024-05-16', desktop: 338, mobile: 400 },
+ { date: '2024-05-17', desktop: 499, mobile: 420 },
+ { date: '2024-05-18', desktop: 315, mobile: 350 },
+ { date: '2024-05-19', desktop: 235, mobile: 180 },
+ { date: '2024-05-20', desktop: 177, mobile: 230 },
+ { date: '2024-05-21', desktop: 82, mobile: 140 },
+ { date: '2024-05-22', desktop: 81, mobile: 120 },
+ { date: '2024-05-23', desktop: 252, mobile: 290 },
+ { date: '2024-05-24', desktop: 294, mobile: 220 },
+ { date: '2024-05-25', desktop: 201, mobile: 250 },
+ { date: '2024-05-26', desktop: 213, mobile: 170 },
+ { date: '2024-05-27', desktop: 420, mobile: 460 },
+ { date: '2024-05-28', desktop: 233, mobile: 190 },
+ { date: '2024-05-29', desktop: 78, mobile: 130 },
+ { date: '2024-05-30', desktop: 340, mobile: 280 },
+ { date: '2024-05-31', desktop: 178, mobile: 230 },
+ { date: '2024-06-01', desktop: 178, mobile: 200 },
+ { date: '2024-06-02', desktop: 470, mobile: 410 },
+ { date: '2024-06-03', desktop: 103, mobile: 160 },
+ { date: '2024-06-04', desktop: 439, mobile: 380 },
+ { date: '2024-06-05', desktop: 88, mobile: 140 },
+ { date: '2024-06-06', desktop: 294, mobile: 250 },
+ { date: '2024-06-07', desktop: 323, mobile: 370 },
+ { date: '2024-06-08', desktop: 385, mobile: 320 },
+ { date: '2024-06-09', desktop: 438, mobile: 480 },
+ { date: '2024-06-10', desktop: 155, mobile: 200 },
+ { date: '2024-06-11', desktop: 92, mobile: 150 },
+ { date: '2024-06-12', desktop: 492, mobile: 420 },
+ { date: '2024-06-13', desktop: 81, mobile: 130 },
+ { date: '2024-06-14', desktop: 426, mobile: 380 },
+ { date: '2024-06-15', desktop: 307, mobile: 350 },
+ { date: '2024-06-16', desktop: 371, mobile: 310 },
+ { date: '2024-06-17', desktop: 475, mobile: 520 },
+ { date: '2024-06-18', desktop: 107, mobile: 170 },
+ { date: '2024-06-19', desktop: 341, mobile: 290 },
+ { date: '2024-06-20', desktop: 408, mobile: 450 },
+ { date: '2024-06-21', desktop: 169, mobile: 210 },
+ { date: '2024-06-22', desktop: 317, mobile: 270 },
+ { date: '2024-06-23', desktop: 480, mobile: 530 },
+ { date: '2024-06-24', desktop: 132, mobile: 180 },
+ { date: '2024-06-25', desktop: 141, mobile: 190 },
+ { date: '2024-06-26', desktop: 434, mobile: 380 },
+ { date: '2024-06-27', desktop: 448, mobile: 490 },
+ { date: '2024-06-28', desktop: 149, mobile: 200 },
+ { date: '2024-06-29', desktop: 103, mobile: 160 },
+ { date: '2024-06-30', desktop: 446, mobile: 400 },
+]
+
+const chartConfig = {
+ views: {
+ label: 'Page Views',
+ },
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ const [activeChart, setActiveChart] = React.useState<keyof typeof chartConfig>('desktop')
+
+ const total = React.useMemo(
+ () => ({
+ desktop: chartData.reduce((acc, curr) => acc + curr.desktop, 0),
+ mobile: chartData.reduce((acc, curr) => acc + curr.mobile, 0),
+ }),
+ []
+ )
+
+ return (
+ <Card>
+ <CardHeader className="flex flex-col items-stretch space-y-0 border-b p-0 sm:flex-row">
+ <div className="flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6">
+ <CardTitle>Bar Chart - Interactive</CardTitle>
+ <CardDescription>Showing total visitors for the last 3 months</CardDescription>
+ </div>
+ <div className="flex">
+ {['desktop', 'mobile'].map((key) => {
+ const chart = key as keyof typeof chartConfig
+ return (
+ <button
+ key={chart}
+ data-active={activeChart === chart}
+ className="relative z-30 flex flex-1 flex-col justify-center gap-1 border-t px-6 py-4 text-left even:border-l data-[active=true]:bg-surface-100 sm:border-l sm:border-t-0 sm:px-8 sm:py-6"
+ onClick={() => setActiveChart(chart)}
+ >
+ <span className="text-xs text-foreground-lighter">{chartConfig[chart].label}</span>
+ <span className="text-lg font-bold leading-none sm:text-3xl">
+ {total[key as keyof typeof total].toLocaleString()}
+ </span>
+ </button>
+ )
+ })}
+ </div>
+ </CardHeader>
+ <CardContent className="px-2 sm:p-6">
+ <ChartContainer config={chartConfig} className="aspect-auto h-[250px] w-full">
+ <BarChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="date"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ minTickGap={32}
+ tickFormatter={(value) => {
+ const date = new Date(value)
+ return date.toLocaleDateString('en-US', {
+ month: 'short',
+ day: 'numeric',
+ })
+ }}
+ />
+ <ChartTooltip
+ content={
+ <ChartTooltipContent
+ className="w-[150px]"
+ nameKey="views"
+ labelFormatter={(value) => {
+ return new Date(value).toLocaleDateString('en-US', {
+ month: 'short',
+ day: 'numeric',
+ year: 'numeric',
+ })
+ }}
+ />
+ }
+ />
+ <Bar dataKey={activeChart} fill={`var(--color-${activeChart})`} />
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-bar-label-custom.tsx b/apps/design-system/registry/default/block/chart-bar-label-custom.tsx
new file mode 100644
index 00000000000..7867342bc6d
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-bar-label-custom.tsx
@@ -0,0 +1,92 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, CartesianGrid, LabelList, XAxis, YAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A bar chart with a custom label'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+ label: {
+ color: 'hsl(var(--background))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Custom Label</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart
+ accessibilityLayer
+ data={chartData}
+ layout="vertical"
+ margin={{
+ right: 16,
+ }}
+ >
+ <CartesianGrid horizontal={false} />
+ <YAxis
+ dataKey="month"
+ type="category"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ hide
+ />
+ <XAxis dataKey="desktop" type="number" hide />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <Bar dataKey="desktop" layout="vertical" fill="var(--color-desktop)" radius={4}>
+ <LabelList
+ dataKey="month"
+ position="insideLeft"
+ offset={8}
+ className="fill-[--color-label]"
+ fontSize={12}
+ />
+ <LabelList
+ dataKey="desktop"
+ position="right"
+ offset={8}
+ className="fill-foreground"
+ fontSize={12}
+ />
+ </Bar>
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-bar-label.tsx b/apps/design-system/registry/default/block/chart-bar-label.tsx
new file mode 100644
index 00000000000..3bbdcc7a7ea
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-bar-label.tsx
@@ -0,0 +1,68 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, CartesianGrid, LabelList, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A bar chart with a label'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Label</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ top: 20,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={8}>
+ <LabelList position="top" offset={12} className="fill-foreground" fontSize={12} />
+ </Bar>
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-bar-mixed.tsx b/apps/design-system/registry/default/block/chart-bar-mixed.tsx
new file mode 100644
index 00000000000..1790507f73f
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-bar-mixed.tsx
@@ -0,0 +1,86 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, XAxis, YAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A mixed bar chart'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Mixed</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart
+ accessibilityLayer
+ data={chartData}
+ layout="vertical"
+ margin={{
+ left: 0,
+ }}
+ >
+ <YAxis
+ dataKey="browser"
+ type="category"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => chartConfig[value as keyof typeof chartConfig]?.label}
+ />
+ <XAxis dataKey="visitors" type="number" hide />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Bar dataKey="visitors" layout="vertical" radius={5} />
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-bar-multiple.tsx b/apps/design-system/registry/default/block/chart-bar-multiple.tsx
new file mode 100644
index 00000000000..ffb9c61679a
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-bar-multiple.tsx
@@ -0,0 +1,65 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A multiple bar chart'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Multiple</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="dashed" />} />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
+ <Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-bar-negative.tsx b/apps/design-system/registry/default/block/chart-bar-negative.tsx
new file mode 100644
index 00000000000..43f87ef0762
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-bar-negative.tsx
@@ -0,0 +1,63 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, CartesianGrid, Cell, LabelList } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A bar chart with negative values'
+
+const chartData = [
+ { month: 'January', visitors: 186 },
+ { month: 'February', visitors: 205 },
+ { month: 'March', visitors: -207 },
+ { month: 'April', visitors: 173 },
+ { month: 'May', visitors: -209 },
+ { month: 'June', visitors: 214 },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Negative</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent hideLabel hideIndicator />}
+ />
+ <Bar dataKey="visitors">
+ <LabelList position="top" dataKey="month" fillOpacity={1} />
+ {chartData.map((item) => (
+ <Cell
+ key={item.month}
+ fill={item.visitors > 0 ? 'hsl(var(--chart-1))' : 'hsl(var(--chart-2))'}
+ />
+ ))}
+ </Bar>
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-bar-stacked.tsx b/apps/design-system/registry/default/block/chart-bar-stacked.tsx
new file mode 100644
index 00000000000..34a7439e982
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-bar-stacked.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import {
+ ChartConfig,
+ ChartContainer,
+ ChartLegend,
+ ChartLegendContent,
+ ChartTooltip,
+ ChartTooltipContent,
+} from 'ui'
+
+export const description = 'A stacked bar chart with a legend'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Bar Chart - Stacked + Legend</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip content={<ChartTooltipContent hideLabel />} />
+ <ChartLegend content={<ChartLegendContent />} />
+ <Bar dataKey="desktop" stackId="a" fill="var(--color-desktop)" radius={[0, 0, 4, 4]} />
+ <Bar dataKey="mobile" stackId="a" fill="var(--color-mobile)" radius={[4, 4, 0, 0]} />
+ </BarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-line-default.tsx b/apps/design-system/registry/default/block/chart-line-default.tsx
new file mode 100644
index 00000000000..408dc1d6f9f
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-line-default.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A line chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Line
+ dataKey="desktop"
+ type="natural"
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ dot={false}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-line-dots-colors.tsx b/apps/design-system/registry/default/block/chart-line-dots-colors.tsx
new file mode 100644
index 00000000000..c8a55a0c44b
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-line-dots-colors.tsx
@@ -0,0 +1,100 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, Dot, Line, LineChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A line chart with dots and colors'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ color: 'hsl(var(--chart-2))',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Dots Colors</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ top: 24,
+ left: 24,
+ right: 24,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent indicator="line" nameKey="visitors" hideLabel />}
+ />
+ <Line
+ dataKey="visitors"
+ type="natural"
+ stroke="var(--color-visitors)"
+ strokeWidth={2}
+ dot={({ payload, ...props }) => {
+ return (
+ <Dot
+ key={payload.browser}
+ r={5}
+ cx={props.cx}
+ cy={props.cy}
+ fill={payload.fill}
+ stroke={payload.fill}
+ />
+ )
+ }}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-line-dots-custom.tsx b/apps/design-system/registry/default/block/chart-line-dots-custom.tsx
new file mode 100644
index 00000000000..87c69309319
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-line-dots-custom.tsx
@@ -0,0 +1,90 @@
+'use client'
+
+import { GitCommitVertical, TrendingUp } from 'lucide-react'
+import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A line chart with custom dots'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Custom Dots</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Line
+ dataKey="desktop"
+ type="natural"
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ dot={({ cx, cy, payload }) => {
+ const r = 24
+ return (
+ <GitCommitVertical
+ key={payload.month}
+ x={cx - r / 2}
+ y={cy - r / 2}
+ width={r}
+ height={r}
+ fill="hsl(var(--background))"
+ stroke="var(--color-desktop)"
+ />
+ )
+ }}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-line-dots.tsx b/apps/design-system/registry/default/block/chart-line-dots.tsx
new file mode 100644
index 00000000000..cc211f2c2b4
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-line-dots.tsx
@@ -0,0 +1,82 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A line chart with dots'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Dots</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Line
+ dataKey="desktop"
+ type="natural"
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ dot={{
+ fill: 'var(--color-desktop)',
+ }}
+ activeDot={{
+ r: 6,
+ }}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-line-interactive.tsx b/apps/design-system/registry/default/block/chart-line-interactive.tsx
new file mode 100644
index 00000000000..5f9c92b9792
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-line-interactive.tsx
@@ -0,0 +1,208 @@
+'use client'
+
+import * as React from 'react'
+import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'An interactive line chart'
+
+const chartData = [
+ { date: '2024-04-01', desktop: 222, mobile: 150 },
+ { date: '2024-04-02', desktop: 97, mobile: 180 },
+ { date: '2024-04-03', desktop: 167, mobile: 120 },
+ { date: '2024-04-04', desktop: 242, mobile: 260 },
+ { date: '2024-04-05', desktop: 373, mobile: 290 },
+ { date: '2024-04-06', desktop: 301, mobile: 340 },
+ { date: '2024-04-07', desktop: 245, mobile: 180 },
+ { date: '2024-04-08', desktop: 409, mobile: 320 },
+ { date: '2024-04-09', desktop: 59, mobile: 110 },
+ { date: '2024-04-10', desktop: 261, mobile: 190 },
+ { date: '2024-04-11', desktop: 327, mobile: 350 },
+ { date: '2024-04-12', desktop: 292, mobile: 210 },
+ { date: '2024-04-13', desktop: 342, mobile: 380 },
+ { date: '2024-04-14', desktop: 137, mobile: 220 },
+ { date: '2024-04-15', desktop: 120, mobile: 170 },
+ { date: '2024-04-16', desktop: 138, mobile: 190 },
+ { date: '2024-04-17', desktop: 446, mobile: 360 },
+ { date: '2024-04-18', desktop: 364, mobile: 410 },
+ { date: '2024-04-19', desktop: 243, mobile: 180 },
+ { date: '2024-04-20', desktop: 89, mobile: 150 },
+ { date: '2024-04-21', desktop: 137, mobile: 200 },
+ { date: '2024-04-22', desktop: 224, mobile: 170 },
+ { date: '2024-04-23', desktop: 138, mobile: 230 },
+ { date: '2024-04-24', desktop: 387, mobile: 290 },
+ { date: '2024-04-25', desktop: 215, mobile: 250 },
+ { date: '2024-04-26', desktop: 75, mobile: 130 },
+ { date: '2024-04-27', desktop: 383, mobile: 420 },
+ { date: '2024-04-28', desktop: 122, mobile: 180 },
+ { date: '2024-04-29', desktop: 315, mobile: 240 },
+ { date: '2024-04-30', desktop: 454, mobile: 380 },
+ { date: '2024-05-01', desktop: 165, mobile: 220 },
+ { date: '2024-05-02', desktop: 293, mobile: 310 },
+ { date: '2024-05-03', desktop: 247, mobile: 190 },
+ { date: '2024-05-04', desktop: 385, mobile: 420 },
+ { date: '2024-05-05', desktop: 481, mobile: 390 },
+ { date: '2024-05-06', desktop: 498, mobile: 520 },
+ { date: '2024-05-07', desktop: 388, mobile: 300 },
+ { date: '2024-05-08', desktop: 149, mobile: 210 },
+ { date: '2024-05-09', desktop: 227, mobile: 180 },
+ { date: '2024-05-10', desktop: 293, mobile: 330 },
+ { date: '2024-05-11', desktop: 335, mobile: 270 },
+ { date: '2024-05-12', desktop: 197, mobile: 240 },
+ { date: '2024-05-13', desktop: 197, mobile: 160 },
+ { date: '2024-05-14', desktop: 448, mobile: 490 },
+ { date: '2024-05-15', desktop: 473, mobile: 380 },
+ { date: '2024-05-16', desktop: 338, mobile: 400 },
+ { date: '2024-05-17', desktop: 499, mobile: 420 },
+ { date: '2024-05-18', desktop: 315, mobile: 350 },
+ { date: '2024-05-19', desktop: 235, mobile: 180 },
+ { date: '2024-05-20', desktop: 177, mobile: 230 },
+ { date: '2024-05-21', desktop: 82, mobile: 140 },
+ { date: '2024-05-22', desktop: 81, mobile: 120 },
+ { date: '2024-05-23', desktop: 252, mobile: 290 },
+ { date: '2024-05-24', desktop: 294, mobile: 220 },
+ { date: '2024-05-25', desktop: 201, mobile: 250 },
+ { date: '2024-05-26', desktop: 213, mobile: 170 },
+ { date: '2024-05-27', desktop: 420, mobile: 460 },
+ { date: '2024-05-28', desktop: 233, mobile: 190 },
+ { date: '2024-05-29', desktop: 78, mobile: 130 },
+ { date: '2024-05-30', desktop: 340, mobile: 280 },
+ { date: '2024-05-31', desktop: 178, mobile: 230 },
+ { date: '2024-06-01', desktop: 178, mobile: 200 },
+ { date: '2024-06-02', desktop: 470, mobile: 410 },
+ { date: '2024-06-03', desktop: 103, mobile: 160 },
+ { date: '2024-06-04', desktop: 439, mobile: 380 },
+ { date: '2024-06-05', desktop: 88, mobile: 140 },
+ { date: '2024-06-06', desktop: 294, mobile: 250 },
+ { date: '2024-06-07', desktop: 323, mobile: 370 },
+ { date: '2024-06-08', desktop: 385, mobile: 320 },
+ { date: '2024-06-09', desktop: 438, mobile: 480 },
+ { date: '2024-06-10', desktop: 155, mobile: 200 },
+ { date: '2024-06-11', desktop: 92, mobile: 150 },
+ { date: '2024-06-12', desktop: 492, mobile: 420 },
+ { date: '2024-06-13', desktop: 81, mobile: 130 },
+ { date: '2024-06-14', desktop: 426, mobile: 380 },
+ { date: '2024-06-15', desktop: 307, mobile: 350 },
+ { date: '2024-06-16', desktop: 371, mobile: 310 },
+ { date: '2024-06-17', desktop: 475, mobile: 520 },
+ { date: '2024-06-18', desktop: 107, mobile: 170 },
+ { date: '2024-06-19', desktop: 341, mobile: 290 },
+ { date: '2024-06-20', desktop: 408, mobile: 450 },
+ { date: '2024-06-21', desktop: 169, mobile: 210 },
+ { date: '2024-06-22', desktop: 317, mobile: 270 },
+ { date: '2024-06-23', desktop: 480, mobile: 530 },
+ { date: '2024-06-24', desktop: 132, mobile: 180 },
+ { date: '2024-06-25', desktop: 141, mobile: 190 },
+ { date: '2024-06-26', desktop: 434, mobile: 380 },
+ { date: '2024-06-27', desktop: 448, mobile: 490 },
+ { date: '2024-06-28', desktop: 149, mobile: 200 },
+ { date: '2024-06-29', desktop: 103, mobile: 160 },
+ { date: '2024-06-30', desktop: 446, mobile: 400 },
+]
+
+const chartConfig = {
+ views: {
+ label: 'Page Views',
+ },
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ const [activeChart, setActiveChart] = React.useState<keyof typeof chartConfig>('desktop')
+
+ const total = React.useMemo(
+ () => ({
+ desktop: chartData.reduce((acc, curr) => acc + curr.desktop, 0),
+ mobile: chartData.reduce((acc, curr) => acc + curr.mobile, 0),
+ }),
+ []
+ )
+
+ return (
+ <Card>
+ <CardHeader className="flex flex-col items-stretch space-y-0 border-b p-0 sm:flex-row">
+ <div className="flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6">
+ <CardTitle>Line Chart - Interactive</CardTitle>
+ <CardDescription>Showing total visitors for the last 3 months</CardDescription>
+ </div>
+ <div className="flex">
+ {['desktop', 'mobile'].map((key) => {
+ const chart = key as keyof typeof chartConfig
+ return (
+ <button
+ key={chart}
+ data-active={activeChart === chart}
+ className="flex flex-1 flex-col justify-center gap-1 border-t px-6 py-4 text-left even:border-l data-[active=true]:bg-muted/50 sm:border-l sm:border-t-0 sm:px-8 sm:py-6"
+ onClick={() => setActiveChart(chart)}
+ >
+ <span className="text-xs text-muted-foreground">{chartConfig[chart].label}</span>
+ <span className="text-lg font-bold leading-none sm:text-3xl">
+ {total[key as keyof typeof total].toLocaleString()}
+ </span>
+ </button>
+ )
+ })}
+ </div>
+ </CardHeader>
+ <CardContent className="px-2 sm:p-6">
+ <ChartContainer config={chartConfig} className="aspect-auto h-[250px] w-full">
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="date"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ minTickGap={32}
+ tickFormatter={(value) => {
+ const date = new Date(value)
+ return date.toLocaleDateString('en-US', {
+ month: 'short',
+ day: 'numeric',
+ })
+ }}
+ />
+ <ChartTooltip
+ content={
+ <ChartTooltipContent
+ className="w-[150px]"
+ nameKey="views"
+ labelFormatter={(value) => {
+ return new Date(value).toLocaleDateString('en-US', {
+ month: 'short',
+ day: 'numeric',
+ year: 'numeric',
+ })
+ }}
+ />
+ }
+ />
+ <Line
+ dataKey={activeChart}
+ type="monotone"
+ stroke={`var(--color-${activeChart})`}
+ strokeWidth={2}
+ dot={false}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-line-label-custom.tsx b/apps/design-system/registry/default/block/chart-line-label-custom.tsx
new file mode 100644
index 00000000000..3d84fec03a3
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-line-label-custom.tsx
@@ -0,0 +1,103 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, LabelList, Line, LineChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A line chart with a custom label'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ color: 'hsl(var(--chart-2))',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Custom Label</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ top: 24,
+ left: 24,
+ right: 24,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent indicator="line" nameKey="visitors" hideLabel />}
+ />
+ <Line
+ dataKey="visitors"
+ type="natural"
+ stroke="var(--color-visitors)"
+ strokeWidth={2}
+ dot={{
+ fill: 'var(--color-visitors)',
+ }}
+ activeDot={{
+ r: 6,
+ }}
+ >
+ <LabelList
+ position="top"
+ offset={12}
+ className="fill-foreground"
+ fontSize={12}
+ dataKey="browser"
+ formatter={(value: keyof typeof chartConfig) => chartConfig[value]?.label}
+ />
+ </Line>
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-line-label.tsx b/apps/design-system/registry/default/block/chart-line-label.tsx
new file mode 100644
index 00000000000..2c187e95961
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-line-label.tsx
@@ -0,0 +1,85 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, LabelList, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A line chart with a label'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Label</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ top: 20,
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <Line
+ dataKey="desktop"
+ type="natural"
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ dot={{
+ fill: 'var(--color-desktop)',
+ }}
+ activeDot={{
+ r: 6,
+ }}
+ >
+ <LabelList position="top" offset={12} className="fill-foreground" fontSize={12} />
+ </Line>
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-line-linear.tsx b/apps/design-system/registry/default/block/chart-line-linear.tsx
new file mode 100644
index 00000000000..9219a3c9de4
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-line-linear.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A linear line chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Linear</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Line
+ dataKey="desktop"
+ type="linear"
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ dot={false}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-line-multiple.tsx b/apps/design-system/registry/default/block/chart-line-multiple.tsx
new file mode 100644
index 00000000000..f09714a2737
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-line-multiple.tsx
@@ -0,0 +1,88 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A multiple line chart'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Multiple</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
+ <Line
+ dataKey="desktop"
+ type="monotone"
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ dot={false}
+ />
+ <Line
+ dataKey="mobile"
+ type="monotone"
+ stroke="var(--color-mobile)"
+ strokeWidth={2}
+ dot={false}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter>
+ <div className="flex w-full items-start gap-2 text-sm">
+ <div className="grid gap-2">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </div>
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-line-step.tsx b/apps/design-system/registry/default/block/chart-line-step.tsx
new file mode 100644
index 00000000000..0ab71e07d09
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-line-step.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A line chart with step'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 73 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>Line Chart - Step</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig}>
+ <LineChart
+ accessibilityLayer
+ data={chartData}
+ margin={{
+ left: 12,
+ right: 12,
+ }}
+ >
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ axisLine={false}
+ tickMargin={8}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Line
+ dataKey="desktop"
+ type="step"
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ dot={false}
+ />
+ </LineChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col items-start gap-2 text-sm">
+ <div className="flex gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-pie-donut-active.tsx b/apps/design-system/registry/default/block/chart-pie-donut-active.tsx
new file mode 100644
index 00000000000..2490b50f65f
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-pie-donut-active.tsx
@@ -0,0 +1,81 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Label, Pie, PieChart, Sector } from 'recharts'
+import { PieSectorDataItem } from 'recharts/types/polar/Pie'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A donut chart with an active sector'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Donut Active</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Pie
+ data={chartData}
+ dataKey="visitors"
+ nameKey="browser"
+ innerRadius={60}
+ strokeWidth={5}
+ activeIndex={0}
+ activeShape={({ outerRadius = 0, ...props }: PieSectorDataItem) => (
+ <Sector {...props} outerRadius={outerRadius + 10} />
+ )}
+ />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-pie-donut-text.tsx b/apps/design-system/registry/default/block/chart-pie-donut-text.tsx
new file mode 100644
index 00000000000..cba1eee8492
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-pie-donut-text.tsx
@@ -0,0 +1,111 @@
+'use client'
+
+import * as React from 'react'
+import { TrendingUp } from 'lucide-react'
+import { Label, Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A donut chart with text'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 287, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 190, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ const totalVisitors = React.useMemo(() => {
+ return chartData.reduce((acc, curr) => acc + curr.visitors, 0)
+ }, [])
+
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Donut with Text</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Pie
+ data={chartData}
+ dataKey="visitors"
+ nameKey="browser"
+ innerRadius={60}
+ strokeWidth={5}
+ >
+ <Label
+ content={({ viewBox }) => {
+ if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
+ return (
+ <text
+ x={viewBox.cx}
+ y={viewBox.cy}
+ textAnchor="middle"
+ dominantBaseline="middle"
+ >
+ <tspan
+ x={viewBox.cx}
+ y={viewBox.cy}
+ className="fill-foreground text-3xl font-bold"
+ >
+ {totalVisitors.toLocaleString()}
+ </tspan>
+ <tspan
+ x={viewBox.cx}
+ y={(viewBox.cy || 0) + 24}
+ className="fill-muted-foreground"
+ >
+ Visitors
+ </tspan>
+ </text>
+ )
+ }
+ }}
+ />
+ </Pie>
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-pie-donut.tsx b/apps/design-system/registry/default/block/chart-pie-donut.tsx
new file mode 100644
index 00000000000..328fbd4b48a
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-pie-donut.tsx
@@ -0,0 +1,70 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A donut chart'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Donut</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Pie data={chartData} dataKey="visitors" nameKey="browser" innerRadius={60} />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-pie-interactive.tsx b/apps/design-system/registry/default/block/chart-pie-interactive.tsx
new file mode 100644
index 00000000000..be05cbf8e41
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-pie-interactive.tsx
@@ -0,0 +1,170 @@
+'use client'
+
+import * as React from 'react'
+import { Label, Pie, PieChart, Sector } from 'recharts'
+import { PieSectorDataItem } from 'recharts/types/polar/Pie'
+
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartStyle, ChartTooltip, ChartTooltipContent } from 'ui'
+import {
+ Select_Shadcn_,
+ SelectContent_Shadcn_,
+ SelectItem_Shadcn_,
+ SelectTrigger_Shadcn_,
+ SelectValue_Shadcn_,
+} from 'ui'
+
+export const description = 'An interactive pie chart'
+
+const desktopData = [
+ { month: 'january', desktop: 186, fill: 'var(--color-january)' },
+ { month: 'february', desktop: 305, fill: 'var(--color-february)' },
+ { month: 'march', desktop: 237, fill: 'var(--color-march)' },
+ { month: 'april', desktop: 173, fill: 'var(--color-april)' },
+ { month: 'may', desktop: 209, fill: 'var(--color-may)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ desktop: {
+ label: 'Desktop',
+ },
+ mobile: {
+ label: 'Mobile',
+ },
+ january: {
+ label: 'January',
+ color: 'hsl(var(--chart-1))',
+ },
+ february: {
+ label: 'February',
+ color: 'hsl(var(--chart-2))',
+ },
+ march: {
+ label: 'March',
+ color: 'hsl(var(--chart-3))',
+ },
+ april: {
+ label: 'April',
+ color: 'hsl(var(--chart-4))',
+ },
+ may: {
+ label: 'May',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ const id = 'pie-interactive'
+ const [activeMonth, setActiveMonth] = React.useState(desktopData[0].month)
+
+ const activeIndex = React.useMemo(
+ () => desktopData.findIndex((item) => item.month === activeMonth),
+ [activeMonth]
+ )
+ const months = React.useMemo(() => desktopData.map((item) => item.month), [])
+
+ return (
+ <Card data-chart={id} className="flex flex-col">
+ <ChartStyle id={id} config={chartConfig} />
+ <CardHeader className="flex-row items-start space-y-0 pb-0">
+ <div className="grid gap-1">
+ <CardTitle>Pie Chart - Interactive</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </div>
+ <Select_Shadcn_ value={activeMonth} onValueChange={setActiveMonth}>
+ <SelectTrigger_Shadcn_
+ className="ml-auto h-7 w-[130px] rounded-lg pl-2.5"
+ aria-label="Select a value"
+ >
+ <SelectValue_Shadcn_ placeholder="Select month" />
+ </SelectTrigger_Shadcn_>
+ <SelectContent_Shadcn_ align="end" className="rounded-xl">
+ {months.map((key) => {
+ const config = chartConfig[key as keyof typeof chartConfig]
+
+ if (!config) {
+ return null
+ }
+
+ return (
+ <SelectItem_Shadcn_ key={key} value={key} className="rounded-lg [&_span]:flex">
+ <div className="flex items-center gap-2 text-xs">
+ <span
+ className="flex h-3 w-3 shrink-0 rounded-sm"
+ style={{
+ backgroundColor: `var(--color-${key})`,
+ }}
+ />
+ {config?.label}
+ </div>
+ </SelectItem_Shadcn_>
+ )
+ })}
+ </SelectContent_Shadcn_>
+ </Select_Shadcn_>
+ </CardHeader>
+ <CardContent className="flex flex-1 justify-center pb-0">
+ <ChartContainer
+ id={id}
+ config={chartConfig}
+ className="mx-auto aspect-square w-full max-w-[300px]"
+ >
+ <PieChart>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Pie
+ data={desktopData}
+ dataKey="desktop"
+ nameKey="month"
+ innerRadius={60}
+ strokeWidth={5}
+ activeIndex={activeIndex}
+ activeShape={({ outerRadius = 0, ...props }: PieSectorDataItem) => (
+ <g>
+ <Sector {...props} outerRadius={outerRadius + 10} />
+ <Sector
+ {...props}
+ outerRadius={outerRadius + 25}
+ innerRadius={outerRadius + 12}
+ />
+ </g>
+ )}
+ >
+ <Label
+ content={({ viewBox }) => {
+ if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
+ return (
+ <text
+ x={viewBox.cx}
+ y={viewBox.cy}
+ textAnchor="middle"
+ dominantBaseline="middle"
+ >
+ <tspan
+ x={viewBox.cx}
+ y={viewBox.cy}
+ className="fill-foreground text-3xl font-bold"
+ >
+ {desktopData[activeIndex].desktop.toLocaleString()}
+ </tspan>
+ <tspan
+ x={viewBox.cx}
+ y={(viewBox.cy || 0) + 24}
+ className="fill-muted-foreground"
+ >
+ Visitors
+ </tspan>
+ </text>
+ )
+ }
+ }}
+ />
+ </Pie>
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-pie-label-custom.tsx b/apps/design-system/registry/default/block/chart-pie-label-custom.tsx
new file mode 100644
index 00000000000..5fcae35aabe
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-pie-label-custom.tsx
@@ -0,0 +1,92 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A pie chart with a custom label'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Custom Label</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip content={<ChartTooltipContent nameKey="visitors" hideLabel />} />
+ <Pie
+ data={chartData}
+ dataKey="visitors"
+ labelLine={false}
+ label={({ payload, ...props }) => {
+ return (
+ <text
+ cx={props.cx}
+ cy={props.cy}
+ x={props.x}
+ y={props.y}
+ textAnchor={props.textAnchor}
+ dominantBaseline={props.dominantBaseline}
+ fill="hsla(var(--foreground))"
+ >
+ {`${
+ chartConfig[payload.browser as keyof typeof chartConfig]?.label
+ } (${payload.visitors})`}
+ </text>
+ )
+ }}
+ nameKey="browser"
+ />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-pie-label-list.tsx b/apps/design-system/registry/default/block/chart-pie-label-list.tsx
new file mode 100644
index 00000000000..814371c307e
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-pie-label-list.tsx
@@ -0,0 +1,78 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { LabelList, Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A pie chart with a label list'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Label List</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip content={<ChartTooltipContent nameKey="visitors" hideLabel />} />
+ <Pie data={chartData} dataKey="visitors">
+ <LabelList
+ dataKey="browser"
+ className="fill-background"
+ stroke="none"
+ fontSize={12}
+ formatter={(value: keyof typeof chartConfig) => chartConfig[value]?.label}
+ />
+ </Pie>
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-pie-label.tsx b/apps/design-system/registry/default/block/chart-pie-label.tsx
new file mode 100644
index 00000000000..408bd68fb95
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-pie-label.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A pie chart with a label'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Label</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer
+ config={chartConfig}
+ className="mx-auto aspect-square max-h-[250px] pb-0 [&_.recharts-pie-label-text]:fill-foreground"
+ >
+ <PieChart>
+ <ChartTooltip content={<ChartTooltipContent hideLabel />} />
+ <Pie data={chartData} dataKey="visitors" label nameKey="browser" />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-pie-legend.tsx b/apps/design-system/registry/default/block/chart-pie-legend.tsx
new file mode 100644
index 00000000000..c72830caf17
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-pie-legend.tsx
@@ -0,0 +1,64 @@
+'use client'
+
+import { Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent } from 'ui'
+
+export const description = 'A pie chart with a legend'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Legend</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[300px]">
+ <PieChart>
+ <Pie data={chartData} dataKey="visitors" />
+ <ChartLegend
+ content={<ChartLegendContent nameKey="browser" />}
+ className="-translate-y-2 flex-wrap gap-2 [&>*]:basis-1/4 [&>*]:justify-center"
+ />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-pie-separator-none.tsx b/apps/design-system/registry/default/block/chart-pie-separator-none.tsx
new file mode 100644
index 00000000000..ed00866c3b8
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-pie-separator-none.tsx
@@ -0,0 +1,70 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A pie chart with no separator'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Separator None</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Pie data={chartData} dataKey="visitors" nameKey="browser" stroke="0" />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-pie-simple.tsx b/apps/design-system/registry/default/block/chart-pie-simple.tsx
new file mode 100644
index 00000000000..a16fb87ca56
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-pie-simple.tsx
@@ -0,0 +1,70 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A simple pie chart'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <Pie data={chartData} dataKey="visitors" nameKey="browser" />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-pie-stacked.tsx b/apps/design-system/registry/default/block/chart-pie-stacked.tsx
new file mode 100644
index 00000000000..a2ab16ba711
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-pie-stacked.tsx
@@ -0,0 +1,97 @@
+'use client'
+
+import * as React from 'react'
+import { TrendingUp } from 'lucide-react'
+import { Label, Pie, PieChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A pie chart with stacked sections'
+
+const desktopData = [
+ { month: 'january', desktop: 186, fill: 'var(--color-january)' },
+ { month: 'february', desktop: 305, fill: 'var(--color-february)' },
+ { month: 'march', desktop: 237, fill: 'var(--color-march)' },
+ { month: 'april', desktop: 173, fill: 'var(--color-april)' },
+ { month: 'may', desktop: 209, fill: 'var(--color-may)' },
+]
+
+const mobileData = [
+ { month: 'january', mobile: 80, fill: 'var(--color-january)' },
+ { month: 'february', mobile: 200, fill: 'var(--color-february)' },
+ { month: 'march', mobile: 120, fill: 'var(--color-march)' },
+ { month: 'april', mobile: 190, fill: 'var(--color-april)' },
+ { month: 'may', mobile: 130, fill: 'var(--color-may)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ desktop: {
+ label: 'Desktop',
+ },
+ mobile: {
+ label: 'Mobile',
+ },
+ january: {
+ label: 'January',
+ color: 'hsl(var(--chart-1))',
+ },
+ february: {
+ label: 'February',
+ color: 'hsl(var(--chart-2))',
+ },
+ march: {
+ label: 'March',
+ color: 'hsl(var(--chart-3))',
+ },
+ april: {
+ label: 'April',
+ color: 'hsl(var(--chart-4))',
+ },
+ may: {
+ label: 'May',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Pie Chart - Stacked</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <PieChart>
+ <ChartTooltip
+ content={
+ <ChartTooltipContent
+ labelKey="visitors"
+ nameKey="month"
+ indicator="line"
+ labelFormatter={(_, payload) => {
+ return chartConfig[payload?.[0].dataKey as keyof typeof chartConfig].label
+ }}
+ />
+ }
+ />
+ <Pie data={desktopData} dataKey="desktop" outerRadius={60} />
+ <Pie data={mobileData} dataKey="mobile" innerRadius={70} outerRadius={90} />
+ </PieChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radar-default.tsx b/apps/design-system/registry/default/block/chart-radar-default.tsx
new file mode 100644
index 00000000000..dc3d4e6d553
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radar-default.tsx
@@ -0,0 +1,54 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 273 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
+ <PolarAngleAxis dataKey="month" />
+ <PolarGrid />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radar-dots.tsx b/apps/design-system/registry/default/block/chart-radar-dots.tsx
new file mode 100644
index 00000000000..bedf14de29b
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radar-dots.tsx
@@ -0,0 +1,62 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with dots'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 273 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center">
+ <CardTitle>Radar Chart - Dots</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
+ <PolarAngleAxis dataKey="month" />
+ <PolarGrid />
+ <Radar
+ dataKey="desktop"
+ fill="var(--color-desktop)"
+ fillOpacity={0.6}
+ dot={{
+ r: 4,
+ fillOpacity: 1,
+ }}
+ />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radar-grid-circle-fill.tsx b/apps/design-system/registry/default/block/chart-radar-grid-circle-fill.tsx
new file mode 100644
index 00000000000..d17d1536225
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radar-grid-circle-fill.tsx
@@ -0,0 +1,54 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with a grid and circle fill'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 285 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 203 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 264 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Grid Circle Filled</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
+ <PolarGrid className="fill-[--color-desktop] opacity-20" gridType="circle" />
+ <PolarAngleAxis dataKey="month" />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.5} />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radar-grid-circle-no-lines.tsx b/apps/design-system/registry/default/block/chart-radar-grid-circle-no-lines.tsx
new file mode 100644
index 00000000000..3e602ac5745
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radar-grid-circle-no-lines.tsx
@@ -0,0 +1,62 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with a grid and circle fill'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 203 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Grid Circle - No lines</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <PolarGrid gridType="circle" radialLines={false} />
+ <PolarAngleAxis dataKey="month" />
+ <Radar
+ dataKey="desktop"
+ fill="var(--color-desktop)"
+ fillOpacity={0.6}
+ dot={{
+ r: 4,
+ fillOpacity: 1,
+ }}
+ />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radar-grid-circle.tsx b/apps/design-system/registry/default/block/chart-radar-grid-circle.tsx
new file mode 100644
index 00000000000..0cc0277a0c4
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radar-grid-circle.tsx
@@ -0,0 +1,62 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with a grid and circle'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 273 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Grid Circle</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <PolarGrid gridType="circle" />
+ <PolarAngleAxis dataKey="month" />
+ <Radar
+ dataKey="desktop"
+ fill="var(--color-desktop)"
+ fillOpacity={0.6}
+ dot={{
+ r: 4,
+ fillOpacity: 1,
+ }}
+ />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radar-grid-custom.tsx b/apps/design-system/registry/default/block/chart-radar-grid-custom.tsx
new file mode 100644
index 00000000000..31614acc9a3
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radar-grid-custom.tsx
@@ -0,0 +1,54 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with a custom grid'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 273 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Grid Custom</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <PolarGrid radialLines={false} polarRadius={[90]} strokeWidth={1} />
+ <PolarAngleAxis dataKey="month" />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radar-grid-fill.tsx b/apps/design-system/registry/default/block/chart-radar-grid-fill.tsx
new file mode 100644
index 00000000000..7745a10fb13
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radar-grid-fill.tsx
@@ -0,0 +1,54 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with a grid filled'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 285 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 203 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 264 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Grid Filled</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <PolarGrid className="fill-[--color-desktop] opacity-20" />
+ <PolarAngleAxis dataKey="month" />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.5} />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radar-grid-none.tsx b/apps/design-system/registry/default/block/chart-radar-grid-none.tsx
new file mode 100644
index 00000000000..a75ac15da18
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radar-grid-none.tsx
@@ -0,0 +1,61 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with no grid'
+
+const chartData = [
+ { month: 'January', desktop: 186 },
+ { month: 'February', desktop: 305 },
+ { month: 'March', desktop: 237 },
+ { month: 'April', desktop: 273 },
+ { month: 'May', desktop: 209 },
+ { month: 'June', desktop: 214 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Grid None</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <PolarAngleAxis dataKey="month" />
+ <Radar
+ dataKey="desktop"
+ fill="var(--color-desktop)"
+ fillOpacity={0.6}
+ dot={{
+ r: 4,
+ fillOpacity: 1,
+ }}
+ />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radar-icons.tsx b/apps/design-system/registry/default/block/chart-radar-icons.tsx
new file mode 100644
index 00000000000..b2a83ad3934
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radar-icons.tsx
@@ -0,0 +1,75 @@
+'use client'
+
+import { ArrowDownFromLine, ArrowUpFromLine, TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import {
+ ChartConfig,
+ ChartContainer,
+ ChartLegend,
+ ChartLegendContent,
+ ChartTooltip,
+ ChartTooltipContent,
+} from 'ui'
+
+export const description = 'A radar chart with icons'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ icon: ArrowDownFromLine,
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ icon: ArrowUpFromLine,
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Icons</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart
+ data={chartData}
+ margin={{
+ top: -40,
+ bottom: -10,
+ }}
+ >
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <PolarAngleAxis dataKey="month" />
+ <PolarGrid />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
+ <Radar dataKey="mobile" fill="var(--color-mobile)" />
+ <ChartLegend className="mt-8" content={<ChartLegendContent />} />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 pt-4 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radar-label-custom.tsx b/apps/design-system/registry/default/block/chart-radar-label-custom.tsx
new file mode 100644
index 00000000000..51edad28517
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radar-label-custom.tsx
@@ -0,0 +1,91 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with a custom label'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Custom Label</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart
+ data={chartData}
+ margin={{
+ top: 10,
+ right: 10,
+ bottom: 10,
+ left: 10,
+ }}
+ >
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <PolarAngleAxis
+ dataKey="month"
+ tick={({ x, y, textAnchor, value, index, ...props }) => {
+ const data = chartData[index]
+
+ return (
+ <text
+ x={x}
+ y={index === 0 ? y - 10 : y}
+ textAnchor={textAnchor}
+ fontSize={13}
+ fontWeight={500}
+ {...props}
+ >
+ <tspan>{data.desktop}</tspan>
+ <tspan className="fill-muted-foreground">/</tspan>
+ <tspan>{data.mobile}</tspan>
+ <tspan x={x} dy={'1rem'} fontSize={12} className="fill-muted-foreground">
+ {data.month}
+ </tspan>
+ </text>
+ )
+ }}
+ />
+
+ <PolarGrid />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
+ <Radar dataKey="mobile" fill="var(--color-mobile)" />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radar-legend.tsx b/apps/design-system/registry/default/block/chart-radar-legend.tsx
new file mode 100644
index 00000000000..1500cc422a3
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radar-legend.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import {
+ ChartConfig,
+ ChartContainer,
+ ChartLegend,
+ ChartLegendContent,
+ ChartTooltip,
+ ChartTooltipContent,
+} from 'ui'
+
+export const description = 'A radar chart with a legend'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Legend</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent>
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart
+ data={chartData}
+ margin={{
+ top: -40,
+ bottom: -10,
+ }}
+ >
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <PolarAngleAxis dataKey="month" />
+ <PolarGrid />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
+ <Radar dataKey="mobile" fill="var(--color-mobile)" />
+ <ChartLegend className="mt-8" content={<ChartLegendContent />} />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 pt-4 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radar-lines-only.tsx b/apps/design-system/registry/default/block/chart-radar-lines-only.tsx
new file mode 100644
index 00000000000..acb880c81c3
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radar-lines-only.tsx
@@ -0,0 +1,71 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with lines only'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 160 },
+ { month: 'February', desktop: 185, mobile: 170 },
+ { month: 'March', desktop: 207, mobile: 180 },
+ { month: 'April', desktop: 173, mobile: 160 },
+ { month: 'May', desktop: 160, mobile: 190 },
+ { month: 'June', desktop: 174, mobile: 204 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Lines Only</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <PolarAngleAxis dataKey="month" />
+ <PolarGrid radialLines={false} />
+ <Radar
+ dataKey="desktop"
+ fill="var(--color-desktop)"
+ fillOpacity={0}
+ stroke="var(--color-desktop)"
+ strokeWidth={2}
+ />
+ <Radar
+ dataKey="mobile"
+ fill="var(--color-mobile)"
+ fillOpacity={0}
+ stroke="var(--color-mobile)"
+ strokeWidth={2}
+ />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radar-multiple.tsx b/apps/design-system/registry/default/block/chart-radar-multiple.tsx
new file mode 100644
index 00000000000..5cc44043950
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radar-multiple.tsx
@@ -0,0 +1,59 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with multiple data'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Multiple</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
+ <PolarAngleAxis dataKey="month" />
+ <PolarGrid />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
+ <Radar dataKey="mobile" fill="var(--color-mobile)" />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radar-radius.tsx b/apps/design-system/registry/default/block/chart-radar-radius.tsx
new file mode 100644
index 00000000000..f6616c4ac00
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radar-radius.tsx
@@ -0,0 +1,67 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, RadarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radar chart with a radius axis'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card>
+ <CardHeader className="items-center pb-4">
+ <CardTitle>Radar Chart - Radius Axis</CardTitle>
+ <CardDescription>Showing total visitors for the last 6 months</CardDescription>
+ </CardHeader>
+ <CardContent className="pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadarChart data={chartData}>
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent indicator="line" labelKey="month" />}
+ />
+ <PolarGrid />
+ <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
+ <Radar dataKey="mobile" fill="var(--color-mobile)" />
+ <PolarRadiusAxis
+ angle={60}
+ stroke="hsla(var(--foreground))"
+ orientation="middle"
+ axisLine={false}
+ />
+ </RadarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="flex items-center gap-2 leading-none text-muted-foreground">
+ January - June 2024
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radial-grid.tsx b/apps/design-system/registry/default/block/chart-radial-grid.tsx
new file mode 100644
index 00000000000..fea6deab0c2
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radial-grid.tsx
@@ -0,0 +1,74 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { PolarGrid, RadialBar, RadialBarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radial chart with a grid'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Radial Chart - Grid</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadialBarChart data={chartData} innerRadius={30} outerRadius={100}>
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent hideLabel nameKey="browser" />}
+ />
+ <PolarGrid gridType="circle" />
+ <RadialBar dataKey="visitors" />
+ </RadialBarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radial-label.tsx b/apps/design-system/registry/default/block/chart-radial-label.tsx
new file mode 100644
index 00000000000..073e8b4ed47
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radial-label.tsx
@@ -0,0 +1,86 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { LabelList, RadialBar, RadialBarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radial chart with a label'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Radial Chart - Label</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadialBarChart
+ data={chartData}
+ startAngle={-90}
+ endAngle={380}
+ innerRadius={30}
+ outerRadius={110}
+ >
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent hideLabel nameKey="browser" />}
+ />
+ <RadialBar dataKey="visitors" background>
+ <LabelList
+ position="insideStart"
+ dataKey="browser"
+ className="fill-white capitalize mix-blend-luminosity"
+ fontSize={11}
+ />
+ </RadialBar>
+ </RadialBarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radial-shape.tsx b/apps/design-system/registry/default/block/chart-radial-shape.tsx
new file mode 100644
index 00000000000..120a2df88d4
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radial-shape.tsx
@@ -0,0 +1,85 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Label, PolarGrid, PolarRadiusAxis, RadialBar, RadialBarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer } from 'ui'
+
+export const description = 'A radial chart with a custom shape'
+
+const chartData = [{ browser: 'safari', visitors: 1260, fill: 'var(--color-safari)' }]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Radial Chart - Shape</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadialBarChart data={chartData} endAngle={100} innerRadius={80} outerRadius={140}>
+ <PolarGrid
+ gridType="circle"
+ radialLines={false}
+ stroke="none"
+ className="first:fill-muted last:fill-background"
+ polarRadius={[86, 74]}
+ />
+ <RadialBar dataKey="visitors" background />
+ <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
+ <Label
+ content={({ viewBox }) => {
+ if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
+ return (
+ <text
+ x={viewBox.cx}
+ y={viewBox.cy}
+ textAnchor="middle"
+ dominantBaseline="middle"
+ >
+ <tspan
+ x={viewBox.cx}
+ y={viewBox.cy}
+ className="fill-foreground text-4xl font-bold"
+ >
+ {chartData[0].visitors.toLocaleString()}
+ </tspan>
+ <tspan
+ x={viewBox.cx}
+ y={(viewBox.cy || 0) + 24}
+ className="fill-muted-foreground"
+ >
+ Visitors
+ </tspan>
+ </text>
+ )
+ }
+ }}
+ />
+ </PolarRadiusAxis>
+ </RadialBarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radial-simple.tsx b/apps/design-system/registry/default/block/chart-radial-simple.tsx
new file mode 100644
index 00000000000..6c7590b2573
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radial-simple.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { RadialBar, RadialBarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radial chart'
+
+const chartData = [
+ { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
+ { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
+ { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
+ { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
+ { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
+]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ chrome: {
+ label: 'Chrome',
+ color: 'hsl(var(--chart-1))',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+ firefox: {
+ label: 'Firefox',
+ color: 'hsl(var(--chart-3))',
+ },
+ edge: {
+ label: 'Edge',
+ color: 'hsl(var(--chart-4))',
+ },
+ other: {
+ label: 'Other',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Radial Chart</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadialBarChart data={chartData} innerRadius={30} outerRadius={110}>
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent hideLabel nameKey="browser" />}
+ />
+ <RadialBar dataKey="visitors" background />
+ </RadialBarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radial-stacked.tsx b/apps/design-system/registry/default/block/chart-radial-stacked.tsx
new file mode 100644
index 00000000000..e38791f9bae
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radial-stacked.tsx
@@ -0,0 +1,90 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Label, PolarRadiusAxis, RadialBar, RadialBarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+export const description = 'A radial chart with stacked sections'
+
+const chartData = [{ month: 'january', desktop: 1260, mobile: 570 }]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: 'hsl(var(--chart-1))',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ const totalVisitors = chartData[0].desktop + chartData[0].mobile
+
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Radial Chart - Stacked</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex flex-1 items-center pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square w-full max-w-[250px]">
+ <RadialBarChart data={chartData} endAngle={180} innerRadius={80} outerRadius={130}>
+ <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
+ <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
+ <Label
+ content={({ viewBox }) => {
+ if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
+ return (
+ <text x={viewBox.cx} y={viewBox.cy} textAnchor="middle">
+ <tspan
+ x={viewBox.cx}
+ y={(viewBox.cy || 0) - 16}
+ className="fill-foreground text-2xl font-bold"
+ >
+ {totalVisitors.toLocaleString()}
+ </tspan>
+ <tspan
+ x={viewBox.cx}
+ y={(viewBox.cy || 0) + 4}
+ className="fill-muted-foreground"
+ >
+ Visitors
+ </tspan>
+ </text>
+ )
+ }
+ }}
+ />
+ </PolarRadiusAxis>
+ <RadialBar
+ dataKey="desktop"
+ stackId="a"
+ cornerRadius={5}
+ fill="var(--color-desktop)"
+ className="stroke-transparent stroke-2"
+ />
+ <RadialBar
+ dataKey="mobile"
+ fill="var(--color-mobile)"
+ stackId="a"
+ cornerRadius={5}
+ className="stroke-transparent stroke-2"
+ />
+ </RadialBarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-radial-text.tsx b/apps/design-system/registry/default/block/chart-radial-text.tsx
new file mode 100644
index 00000000000..8dd238c505b
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-radial-text.tsx
@@ -0,0 +1,91 @@
+'use client'
+
+import { TrendingUp } from 'lucide-react'
+import { Label, PolarGrid, PolarRadiusAxis, RadialBar, RadialBarChart } from 'recharts'
+
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
+import { ChartConfig, ChartContainer } from 'ui'
+
+export const description = 'A radial chart with text'
+
+const chartData = [{ browser: 'safari', visitors: 200, fill: 'var(--color-safari)' }]
+
+const chartConfig = {
+ visitors: {
+ label: 'Visitors',
+ },
+ safari: {
+ label: 'Safari',
+ color: 'hsl(var(--chart-2))',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <Card className="flex flex-col">
+ <CardHeader className="items-center pb-0">
+ <CardTitle>Radial Chart - Text</CardTitle>
+ <CardDescription>January - June 2024</CardDescription>
+ </CardHeader>
+ <CardContent className="flex-1 pb-0">
+ <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
+ <RadialBarChart
+ data={chartData}
+ startAngle={0}
+ endAngle={250}
+ innerRadius={80}
+ outerRadius={110}
+ >
+ <PolarGrid
+ gridType="circle"
+ radialLines={false}
+ stroke="none"
+ className="first:fill-muted last:fill-background"
+ polarRadius={[86, 74]}
+ />
+ <RadialBar dataKey="visitors" background cornerRadius={10} />
+ <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
+ <Label
+ content={({ viewBox }) => {
+ if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
+ return (
+ <text
+ x={viewBox.cx}
+ y={viewBox.cy}
+ textAnchor="middle"
+ dominantBaseline="middle"
+ >
+ <tspan
+ x={viewBox.cx}
+ y={viewBox.cy}
+ className="fill-foreground text-4xl font-bold"
+ >
+ {chartData[0].visitors.toLocaleString()}
+ </tspan>
+ <tspan
+ x={viewBox.cx}
+ y={(viewBox.cy || 0) + 24}
+ className="fill-muted-foreground"
+ >
+ Visitors
+ </tspan>
+ </text>
+ )
+ }
+ }}
+ />
+ </PolarRadiusAxis>
+ </RadialBarChart>
+ </ChartContainer>
+ </CardContent>
+ <CardFooter className="flex-col gap-2 text-sm">
+ <div className="flex items-center gap-2 font-medium leading-none">
+ Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
+ </div>
+ <div className="leading-none text-muted-foreground">
+ Showing total visitors for the last 6 months
+ </div>
+ </CardFooter>
+ </Card>
+ )
+}
diff --git a/apps/design-system/registry/default/example/chart-bar-demo-axis.tsx b/apps/design-system/registry/default/example/chart-bar-demo-axis.tsx
new file mode 100644
index 00000000000..7ecc971b0cd
--- /dev/null
+++ b/apps/design-system/registry/default/example/chart-bar-demo-axis.tsx
@@ -0,0 +1,43 @@
+'use client'
+
+import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
+import { ChartConfig, ChartContainer } from 'ui'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: '#2563eb',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: '#60a5fa',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <ChartContainer config={chartConfig} className="min-h-[200px] w-full">
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
+ <Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
+ </BarChart>
+ </ChartContainer>
+ )
+}
diff --git a/apps/design-system/registry/default/example/chart-bar-demo-grid.tsx b/apps/design-system/registry/default/example/chart-bar-demo-grid.tsx
new file mode 100644
index 00000000000..73b9783703e
--- /dev/null
+++ b/apps/design-system/registry/default/example/chart-bar-demo-grid.tsx
@@ -0,0 +1,36 @@
+'use client'
+
+import { Bar, BarChart, CartesianGrid } from 'recharts'
+import { ChartConfig, ChartContainer } from 'ui'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: '#2563eb',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: '#60a5fa',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <ChartContainer config={chartConfig} className="min-h-[200px] w-full">
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
+ <Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
+ </BarChart>
+ </ChartContainer>
+ )
+}
diff --git a/apps/design-system/registry/default/example/chart-bar-demo-legend.tsx b/apps/design-system/registry/default/example/chart-bar-demo-legend.tsx
new file mode 100644
index 00000000000..c18c880c725
--- /dev/null
+++ b/apps/design-system/registry/default/example/chart-bar-demo-legend.tsx
@@ -0,0 +1,53 @@
+'use client'
+
+import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
+
+import {
+ ChartConfig,
+ ChartContainer,
+ ChartLegend,
+ ChartLegendContent,
+ ChartTooltip,
+ ChartTooltipContent,
+} from 'ui'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: '#2563eb',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: '#60a5fa',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <ChartContainer config={chartConfig} className="min-h-[200px] w-full">
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip content={<ChartTooltipContent />} />
+ <ChartLegend content={<ChartLegendContent />} />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
+ <Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
+ </BarChart>
+ </ChartContainer>
+ )
+}
diff --git a/apps/design-system/registry/default/example/chart-bar-demo-tooltip.tsx b/apps/design-system/registry/default/example/chart-bar-demo-tooltip.tsx
new file mode 100644
index 00000000000..2d5cdf9b76f
--- /dev/null
+++ b/apps/design-system/registry/default/example/chart-bar-demo-tooltip.tsx
@@ -0,0 +1,45 @@
+'use client'
+
+import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
+
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: '#2563eb',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: '#60a5fa',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <ChartContainer config={chartConfig} className="min-h-[200px] w-full">
+ <BarChart accessibilityLayer data={chartData}>
+ <CartesianGrid vertical={false} />
+ <XAxis
+ dataKey="month"
+ tickLine={false}
+ tickMargin={10}
+ axisLine={false}
+ tickFormatter={(value) => value.slice(0, 3)}
+ />
+ <ChartTooltip content={<ChartTooltipContent />} />
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
+ <Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
+ </BarChart>
+ </ChartContainer>
+ )
+}
diff --git a/apps/design-system/registry/default/example/chart-bar-demo.tsx b/apps/design-system/registry/default/example/chart-bar-demo.tsx
new file mode 100644
index 00000000000..646d11730fb
--- /dev/null
+++ b/apps/design-system/registry/default/example/chart-bar-demo.tsx
@@ -0,0 +1,36 @@
+'use client'
+
+import { Bar, BarChart } from 'recharts'
+
+import { ChartConfig, ChartContainer } from 'ui'
+
+const chartData = [
+ { month: 'January', desktop: 186, mobile: 80 },
+ { month: 'February', desktop: 305, mobile: 200 },
+ { month: 'March', desktop: 237, mobile: 120 },
+ { month: 'April', desktop: 73, mobile: 190 },
+ { month: 'May', desktop: 209, mobile: 130 },
+ { month: 'June', desktop: 214, mobile: 140 },
+]
+
+const chartConfig = {
+ desktop: {
+ label: 'Desktop',
+ color: '#2563eb',
+ },
+ mobile: {
+ label: 'Mobile',
+ color: '#60a5fa',
+ },
+} satisfies ChartConfig
+
+export default function Component() {
+ return (
+ <ChartContainer config={chartConfig} className="min-h-[200px] w-full">
+ <BarChart accessibilityLayer data={chartData}>
+ <Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
+ <Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
+ </BarChart>
+ </ChartContainer>
+ )
+}
diff --git a/apps/design-system/registry/default/example/chart-tooltip-demo.tsx b/apps/design-system/registry/default/example/chart-tooltip-demo.tsx
new file mode 100644
index 00000000000..89f338fda2c
--- /dev/null
+++ b/apps/design-system/registry/default/example/chart-tooltip-demo.tsx
@@ -0,0 +1,205 @@
+'use client'
+
+import * as React from 'react'
+
+import { cn } from '@/lib/utils'
+
+export default function Component() {
+ return (
+ <div className="grid aspect-video w-full max-w-md justify-center text-foreground md:grid-cols-2 [&>div]:relative [&>div]:flex [&>div]:h-[137px] [&>div]:w-[224px] [&>div]:items-center [&>div]:justify-center [&>div]:p-4">
+ <div>
+ <div className="absolute left-[-35px] top-[45px] z-10 text-sm font-medium">Label</div>
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 193 40"
+ width="50"
+ height="12"
+ fill="none"
+ className="absolute left-[5px] top-[50px] z-10"
+ >
+ <g clip-path="url(#a)">
+ <path
+ fill="currentColor"
+ d="M173.928 21.13C115.811 44.938 58.751 45.773 0 26.141c4.227-4.386 7.82-2.715 10.567-1.88 21.133 5.64 42.9 6.266 64.457 7.101 31.066 1.253 60.441-5.848 89.183-17.335 1.268-.418 2.325-1.253 4.861-2.924-14.582-2.924-29.165 2.089-41.845-3.76.212-.835.212-1.879.423-2.714 9.51-.627 19.231-1.253 28.742-2.089 9.51-.835 18.808-1.88 28.318-2.506 6.974-.418 9.933 2.924 7.397 9.19-3.17 8.145-7.608 15.664-11.623 23.391-.423.836-1.057 1.88-1.902 2.298-2.325.835-4.65 1.044-7.186 1.67-.422-2.088-1.479-4.386-1.268-6.265.423-2.506 1.902-4.595 3.804-9.19Z"
+ />
+ </g>
+ <defs>
+ <clipPath id="a">
+ <path fill="currentColor" d="M0 0h193v40H0z" />
+ </clipPath>
+ </defs>
+ </svg>
+ <TooltipDemo
+ label="Page Views"
+ payload={[
+ { name: 'Desktop', value: 186, fill: 'hsl(var(--chart-1))' },
+ { name: 'Mobile', value: 80, fill: 'hsl(var(--chart-2))' },
+ ]}
+ className="w-[8rem]"
+ />
+ </div>
+ <div className="items-end">
+ <div className="absolute left-[122px] top-[0px] z-10 text-sm font-medium">Name</div>
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ width="35"
+ height="42"
+ fill="none"
+ viewBox="0 0 122 148"
+ className="absolute left-[85px] top-[10px] z-10 -scale-x-100"
+ >
+ <g clip-path="url(#ab)">
+ <path
+ fill="currentColor"
+ d="M0 2.65c6.15-4.024 12.299-2.753 17.812-.847a115.56 115.56 0 0 1 21.84 10.59C70.4 32.727 88.849 61.744 96.483 97.54c1.908 9.108 2.544 18.639 3.817 29.017 8.481-4.871 12.934-14.402 21.416-19.909 1.061 4.236-1.06 6.989-2.756 9.319-6.998 9.531-14.207 19.062-21.63 28.382-3.604 4.448-6.36 4.871-10.177 1.059-8.058-7.837-12.935-17.368-14.42-28.382 0-.424.636-1.059 1.485-2.118 9.118 2.33 6.997 13.979 14.843 18.215 3.393-14.614.848-28.593-2.969-42.149-4.029-14.19-9.33-27.746-17.812-39.82-8.27-11.86-18.66-21.392-30.11-30.287C26.93 11.758 14.207 6.039 0 2.65Z"
+ />
+ </g>
+ <defs>
+ <clipPath id="ab">
+ <path fill="currentColor" d="M0 0h122v148H0z" />
+ </clipPath>
+ </defs>
+ </svg>
+ <TooltipDemo
+ label="Browser"
+ hideLabel
+ payload={[
+ { name: 'Chrome', value: 1286, fill: 'hsl(var(--chart-3))' },
+ { name: 'Firefox', value: 1000, fill: 'hsl(var(--chart-4))' },
+ ]}
+ indicator="dashed"
+ className="w-[8rem]"
+ />
+ </div>
+ <div className="!hidden md:!flex">
+ <TooltipDemo
+ label="Page Views"
+ payload={[{ name: 'Desktop', value: 12486, fill: 'hsl(var(--chart-3))' }]}
+ className="w-[9rem]"
+ indicator="line"
+ />
+ </div>
+ <div className="!items-start !justify-start">
+ <div className="absolute left-[50px] top-[60px] z-10 text-sm font-medium">Indicator</div>
+ <TooltipDemo
+ label="Browser"
+ hideLabel
+ payload={[{ name: 'Chrome', value: 1286, fill: 'hsl(var(--chart-1))' }]}
+ indicator="dot"
+ className="w-[8rem]"
+ />
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ width="15"
+ height="34"
+ fill="none"
+ viewBox="0 0 75 175"
+ className="absolute left-[30px] top-[38px] z-10 rotate-[-40deg]"
+ >
+ <g clip-path="url(#abc)">
+ <path
+ fill="currentColor"
+ d="M20.187 175c-4.439-2.109-7.186-2.531-8.032-4.008-3.17-5.484-6.763-10.968-8.454-17.084-5.073-16.242-4.439-32.694-1.057-49.146 5.707-28.053 18.388-52.942 34.24-76.565 1.692-2.531 3.171-5.063 4.862-7.805 0-.21-.211-.632-.634-1.265-4.65 1.265-9.511 2.53-14.161 3.585-2.537.422-5.496.422-8.032-.421-1.48-.422-3.593-2.742-3.593-4.219 0-1.898 1.48-4.218 2.747-5.906 1.057-1.054 2.96-1.265 4.65-1.687C35.406 7.315 48.088 3.729 60.98.776c10.99-2.53 14.584 1.055 13.95 11.812-.634 11.18-.846 22.358-1.268 33.326-.212 3.375-.846 6.96-1.268 10.757-8.878-4.007-8.878-4.007-12.048-38.177C47.03 33.259 38.153 49.289 29.91 65.741 21.667 82.193 16.17 99.49 13.212 117.84c-2.959 18.984.634 36.912 6.975 57.161Z"
+ />
+ </g>
+ <defs>
+ <clipPath id="abc">
+ <path fill="currentColor" d="M0 0h75v175H0z" />
+ </clipPath>
+ </defs>
+ </svg>
+ </div>
+ </div>
+ )
+}
+
+function TooltipDemo({
+ indicator = 'dot',
+ label,
+ payload,
+ hideLabel,
+ hideIndicator,
+ className,
+}: {
+ label: string
+ hideLabel?: boolean
+ hideIndicator?: boolean
+ indicator?: 'line' | 'dot' | 'dashed'
+ payload: {
+ name: string
+ value: number
+ fill: string
+ }[]
+ nameKey?: string
+ labelKey?: string
+} & React.ComponentProps<'div'>) {
+ const tooltipLabel = hideLabel ? null : <div className="font-medium">{label}</div>
+
+ if (!payload?.length) {
+ return null
+ }
+
+ const nestLabel = payload.length === 1 && indicator !== 'dot'
+
+ return (
+ <div
+ className={cn(
+ 'grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl transition-all ease-in-out hover:-translate-y-0.5',
+ className
+ )}
+ >
+ {!nestLabel ? tooltipLabel : null}
+ <div className="grid gap-1.5">
+ {payload.map((item, index) => {
+ const indicatorColor = item.fill
+
+ return (
+ <div
+ key={index}
+ className={cn(
+ 'flex w-full items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground',
+ indicator === 'dot' && 'items-center'
+ )}
+ >
+ <>
+ {!hideIndicator && (
+ <div
+ className={cn(
+ 'shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]',
+ {
+ 'h-2.5 w-2.5': indicator === 'dot',
+ 'w-1': indicator === 'line',
+ 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',
+ 'my-0.5': nestLabel && indicator === 'dashed',
+ }
+ )}
+ style={
+ {
+ '--color-bg': indicatorColor,
+ '--color-border': indicatorColor,
+ } as React.CSSProperties
+ }
+ />
+ )}
+ <div
+ className={cn(
+ 'flex flex-1 justify-between leading-none',
+ nestLabel ? 'items-end' : 'items-center'
+ )}
+ >
+ <div className="grid gap-1.5">
+ {nestLabel ? tooltipLabel : null}
+ <span className="text-muted-foreground">{item.name}</span>
+ </div>
+ <span className="font-mono font-medium tabular-nums text-foreground">
+ {item.value.toLocaleString()}
+ </span>
+ </div>
+ </>
+ </div>
+ )
+ })}
+ </div>
+ </div>
+ )
+}
diff --git a/apps/design-system/registry/default/example/tabs-demo.tsx b/apps/design-system/registry/default/example/tabs-demo.tsx
index e38be55a12d..69dcbbacb4e 100644
--- a/apps/design-system/registry/default/example/tabs-demo.tsx
+++ b/apps/design-system/registry/default/example/tabs-demo.tsx
@@ -1,12 +1,5 @@
import { Button } from 'ui'
-import {
- Card_Shadcn_,
- CardContent_Shadcn_,
- CardDescription_Shadcn_,
- CardFooter_Shadcn_,
- CardHeader_Shadcn_,
- CardTitle_Shadcn_,
-} from 'ui'
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
import { Input_Shadcn_ } from 'ui'
import { Label_Shadcn_ } from 'ui'
import { Tabs_Shadcn_, TabsContent_Shadcn_, TabsList_Shadcn_, TabsTrigger_Shadcn_ } from 'ui'
@@ -19,14 +12,14 @@ export default function TabsDemo() {
<TabsTrigger_Shadcn_ value="password">Password</TabsTrigger_Shadcn_>
</TabsList_Shadcn_>
<TabsContent_Shadcn_ value="account">
- <Card_Shadcn_>
- <CardHeader_Shadcn_>
- <CardTitle_Shadcn_>Account</CardTitle_Shadcn_>
- <CardDescription_Shadcn_>
+ <Card>
+ <CardHeader>
+ <CardTitle>Account</CardTitle>
+ <CardDescription>
Make changes to your account here. Click save when you are done.
- </CardDescription_Shadcn_>
- </CardHeader_Shadcn_>
- <CardContent_Shadcn_ className="space-y-2">
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="space-y-2">
<div className="space-y-1">
<Label_Shadcn_ htmlFor="name">Name</Label_Shadcn_>
<Input_Shadcn_ id="name" defaultValue="Pedro Duarte" />
@@ -35,21 +28,21 @@ export default function TabsDemo() {
<Label_Shadcn_ htmlFor="username">Username</Label_Shadcn_>
<Input_Shadcn_ id="username" defaultValue="@peduarte" />
</div>
- </CardContent_Shadcn_>
- <CardFooter_Shadcn_>
+ </CardContent>
+ <CardFooter>
<Button>Save changes</Button>
- </CardFooter_Shadcn_>
- </Card_Shadcn_>
+ </CardFooter>
+ </Card>
</TabsContent_Shadcn_>
<TabsContent_Shadcn_ value="password">
- <Card_Shadcn_>
- <CardHeader_Shadcn_>
- <CardTitle_Shadcn_>Password</CardTitle_Shadcn_>
- <CardDescription_Shadcn_>
+ <Card>
+ <CardHeader>
+ <CardTitle>Password</CardTitle>
+ <CardDescription>
Change your password here. After saving, you will be logged out.
- </CardDescription_Shadcn_>
- </CardHeader_Shadcn_>
- <CardContent_Shadcn_ className="space-y-2">
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="space-y-2">
<div className="space-y-1">
<Label_Shadcn_ htmlFor="current">Current password</Label_Shadcn_>
<Input_Shadcn_ id="current" type="password" />
@@ -58,11 +51,11 @@ export default function TabsDemo() {
<Label_Shadcn_ htmlFor="new">New password</Label_Shadcn_>
<Input_Shadcn_ id="new" type="password" />
</div>
- </CardContent_Shadcn_>
- <CardFooter_Shadcn_>
+ </CardContent>
+ <CardFooter>
<Button>Save password</Button>
- </CardFooter_Shadcn_>
- </Card_Shadcn_>
+ </CardFooter>
+ </Card>
</TabsContent_Shadcn_>
</Tabs_Shadcn_>
)
diff --git a/apps/design-system/registry/examples.ts b/apps/design-system/registry/examples.ts
index aebdd16585d..4a87159a1d8 100644
--- a/apps/design-system/registry/examples.ts
+++ b/apps/design-system/registry/examples.ts
@@ -1135,6 +1135,36 @@ export const examples: Registry = [
type: 'docs:example',
files: ['example/color-usage-surface-studio-frame.tsx'],
},
+ {
+ name: 'chart-bar-demo',
+ type: 'components:example',
+ files: ['example/chart-bar-demo.tsx'],
+ },
+ {
+ name: 'chart-bar-demo-grid',
+ type: 'components:example',
+ files: ['example/chart-bar-demo-grid.tsx'],
+ },
+ {
+ name: 'chart-bar-demo-axis',
+ type: 'components:example',
+ files: ['example/chart-bar-demo-axis.tsx'],
+ },
+ {
+ name: 'chart-bar-demo-tooltip',
+ type: 'components:example',
+ files: ['example/chart-bar-demo-tooltip.tsx'],
+ },
+ {
+ name: 'chart-bar-demo-legend',
+ type: 'components:example',
+ files: ['example/chart-bar-demo-legend.tsx'],
+ },
+ {
+ name: 'chart-tooltip-demo',
+ type: 'components:example',
+ files: ['example/chart-tooltip-demo.tsx'],
+ },
{
name: 'expanding-textarea-demo',
type: 'docs:example',
diff --git a/apps/design-system/registry/registry.ts b/apps/design-system/registry/registry.ts
index ada50d762af..e03e39fe31b 100644
--- a/apps/design-system/registry/registry.ts
+++ b/apps/design-system/registry/registry.ts
@@ -1,5 +1,6 @@
import { Registry } from '@/registry/schema'
import { examples } from '@/registry//examples'
import { fragments } from '@/registry/fragments'
+import { charts } from '@/registry/charts'
-export const registry: Registry = [...fragments, ...examples]
+export const registry: Registry = [...fragments, ...examples, ...charts]
diff --git a/apps/design-system/scripts/build-registry.mts b/apps/design-system/scripts/build-registry.mts
index ca751b49660..15222376dec 100644
--- a/apps/design-system/scripts/build-registry.mts
+++ b/apps/design-system/scripts/build-registry.mts
@@ -219,6 +219,9 @@ export const Index: Record<string, any> = {
if (type === 'example') {
packagePath = `registry/${style.name}/${type}`
}
+ if (type === 'block') {
+ packagePath = `registry/${style.name}/${type}`
+ }
index += `
"${item.name}": {
diff --git a/apps/design-system/styles/globals.css b/apps/design-system/styles/globals.css
index 6e015819cfb..2f2e162c7a2 100644
--- a/apps/design-system/styles/globals.css
+++ b/apps/design-system/styles/globals.css
@@ -7,52 +7,23 @@
@import './../../../packages/ui/build/css/themes/classic-dark.css';
@import './../../../packages/ui/build/css/themes/light.css';
-/* @layer base {
+@layer base {
:root {
- --background: 0 0% 100%;
- --foreground: 240 10% 3.9%;
- --card: 0 0% 100%;
- --card-foreground: 240 10% 3.9%;
- --popover: 0 0% 100%;
- --popover-foreground: 240 10% 3.9%;
- --primary: 240 5.9% 10%;
- --primary-foreground: 0 0% 98%;
- --secondary: 240 4.8% 95.9%;
- --secondary-foreground: 240 5.9% 10%;
- --muted: 240 4.8% 95.9%;
- --muted-foreground: 240 3.8% 46.1%;
- --accent: 240 4.8% 95.9%;
- --accent-foreground: 240 5.9% 10%;
- --destructive: 0 72.22% 50.59%;
- --destructive-foreground: 0 0% 98%;
- --border: 240 5.9% 90%;
- --input: 240 5.9% 90%;
- --ring: 240 5% 64.9%;
- --radius: 0.5rem;
+ --chart-1: 12 76% 61%;
+ --chart-2: 173 58% 39%;
+ --chart-3: 197 37% 24%;
+ --chart-4: 43 74% 66%;
+ --chart-5: 27 87% 67%;
}
.dark {
- --background: 240 10% 3.9%;
- --foreground: 0 0% 98%;
- --card: 240 10% 3.9%;
- --card-foreground: 0 0% 98%;
- --popover: 240 10% 3.9%;
- --popover-foreground: 0 0% 98%;
- --primary: 0 0% 98%;
- --primary-foreground: 240 5.9% 10%;
- --secondary: 240 3.7% 15.9%;
- --secondary-foreground: 0 0% 98%;
- --muted: 240 3.7% 15.9%;
- --muted-foreground: 240 5% 64.9%;
- --accent: 240 3.7% 15.9%;
- --accent-foreground: 0 0% 98%;
- --destructive: 0 62.8% 30.6%;
- --destructive-foreground: 0 85.7% 97.3%;
- --border: 240 3.7% 15.9%;
- --input: 240 3.7% 15.9%;
- --ring: 240 4.9% 83.9%;
+ --chart-1: 220 70% 50%;
+ --chart-2: 160 60% 45%;
+ --chart-3: 30 80% 55%;
+ --chart-4: 280 65% 60%;
+ --chart-5: 340 75% 55%;
}
-} */
+}
@layer base {
* {
diff --git a/apps/studio/components/ui/Charts/BarChart.tsx b/apps/studio/components/ui/Charts/BarChart.tsx
index ea05d94ae0e..117c4e103bf 100644
--- a/apps/studio/components/ui/Charts/BarChart.tsx
+++ b/apps/studio/components/ui/Charts/BarChart.tsx
@@ -13,7 +13,7 @@ import {
} from 'recharts'
import { CHART_COLORS, DateTimeFormats } from 'components/ui/Charts/Charts.constants'
-import type { CategoricalChartState } from 'recharts/types/chart/generateCategoricalChart'
+import type { CategoricalChartState } from 'recharts/types/chart/types'
import ChartHeader from './ChartHeader'
import type { CommonChartProps, Datum } from './Charts.types'
import { numberFormatter, useChartSize } from './Charts.utils'
diff --git a/apps/www/pages/company.tsx b/apps/www/pages/company.tsx
index 6f66fccf0ce..e7d933e9098 100644
--- a/apps/www/pages/company.tsx
+++ b/apps/www/pages/company.tsx
@@ -15,7 +15,7 @@ import InvestorData from 'data/Investors'
import Image from 'next/image'
import Link from 'next/link'
-import { Button, Card, Space } from 'ui'
+import { Button, Card_legacy_, Space } from 'ui'
import { NextSeo } from 'next-seo'
type Props = {}
@@ -304,7 +304,7 @@ const Press = () => {
<div className="mx-auto mt-5 grid gap-5 lg:max-w-none lg:grid-cols-3">
{PressData.filter((x) => x.type == 'article').map((x) => (
<Link href={x.href} key={x.href} target="_blank">
- <Card key={`press_${x.href}`} hoverable className="h-36">
+ <Card_legacy_ key={`press_${x.href}`} hoverable className="h-36">
<Space className="h-40 justify-between" direction="vertical">
<div>
<h1 className="text-foreground text-xl">{x.type.toUpperCase()}</h1>
@@ -313,14 +313,14 @@ const Press = () => {
</p>
</div>
</Space>
- </Card>
+ </Card_legacy_>
</Link>
))}
</div>
<div className="mx-auto mt-5 grid gap-5 sm:grid-cols-2 lg:max-w-none lg:grid-cols-4">
{PressData.filter((x) => x.type == 'podcast').map((x) => (
<Link href={x.href} key={x.href} target="_blank">
- <Card key={`press_${x.href}`} hoverable className="h-36">
+ <Card_legacy_ key={`press_${x.href}`} hoverable className="h-36">
<Space className="h-40 justify-between" direction="vertical">
<div>
<h1 className="text-foreground text-xl">{x.type.toUpperCase()}</h1>
@@ -329,7 +329,7 @@ const Press = () => {
</p>
</div>
</Space>
- </Card>
+ </Card_legacy_>
</Link>
))}
</div>
diff --git a/package-lock.json b/package-lock.json
index be77673d1c6..81681692aa3 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -18935,10 +18935,6 @@
"node": ">=8.0.0"
}
},
- "node_modules/css-unit-converter": {
- "version": "1.1.2",
- "license": "MIT"
- },
"node_modules/css-what": {
"version": "6.1.0",
"dev": true,
@@ -21488,7 +21484,8 @@
},
"node_modules/fast-equals": {
"version": "5.0.1",
- "license": "MIT",
+ "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.0.1.tgz",
+ "integrity": "sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ==",
"engines": {
"node": ">=6.0.0"
}
@@ -34915,10 +34912,6 @@
"version": "16.13.1",
"license": "MIT"
},
- "node_modules/react-lifecycles-compat": {
- "version": "3.0.4",
- "license": "MIT"
- },
"node_modules/react-markdown": {
"version": "8.0.7",
"license": "MIT",
@@ -35102,17 +35095,6 @@
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0"
}
},
- "node_modules/react-resize-detector": {
- "version": "8.1.0",
- "license": "MIT",
- "dependencies": {
- "lodash": "^4.17.21"
- },
- "peerDependencies": {
- "react": "^16.0.0 || ^17.0.0 || ^18.0.0",
- "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
- }
- },
"node_modules/react-simple-maps": {
"version": "4.0.0-beta.6",
"resolved": "https://registry.npmjs.org/react-simple-maps/-/react-simple-maps-4.0.0-beta.6.tgz",
@@ -35130,37 +35112,17 @@
}
},
"node_modules/react-smooth": {
- "version": "2.0.4",
- "license": "MIT",
- "dependencies": {
- "fast-equals": "^5.0.0",
- "react-transition-group": "2.9.0"
- },
- "peerDependencies": {
- "prop-types": "^15.6.0",
- "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
- "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
- }
- },
- "node_modules/react-smooth/node_modules/dom-helpers": {
- "version": "3.4.0",
- "license": "MIT",
- "dependencies": {
- "@babel/runtime": "^7.1.2"
- }
- },
- "node_modules/react-smooth/node_modules/react-transition-group": {
- "version": "2.9.0",
- "license": "BSD-3-Clause",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/react-smooth/-/react-smooth-4.0.1.tgz",
+ "integrity": "sha512-OE4hm7XqR0jNOq3Qmk9mFLyd6p2+j6bvbPJ7qlB7+oo0eNcL2l7WQzG6MBnT3EXY6xzkLMUBec3AfewJdA0J8w==",
"dependencies": {
- "dom-helpers": "^3.4.0",
- "loose-envify": "^1.4.0",
- "prop-types": "^15.6.2",
- "react-lifecycles-compat": "^3.0.4"
+ "fast-equals": "^5.0.1",
+ "prop-types": "^15.8.1",
+ "react-transition-group": "^4.4.5"
},
"peerDependencies": {
- "react": ">=15.0.0",
- "react-dom": ">=15.0.0"
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
}
},
"node_modules/react-style-singleton": {
@@ -35464,24 +35426,23 @@
}
},
"node_modules/recharts": {
- "version": "2.8.0",
- "license": "MIT",
+ "version": "2.12.7",
+ "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.12.7.tgz",
+ "integrity": "sha512-hlLJMhPQfv4/3NBSAyq3gzGg4h2v69RJh6KU7b3pXYNNAELs9kEoXOjbkxdXpALqKBoVmVptGfLpxdaVYqjmXQ==",
"dependencies": {
- "classnames": "^2.2.5",
+ "clsx": "^2.0.0",
"eventemitter3": "^4.0.1",
- "lodash": "^4.17.19",
+ "lodash": "^4.17.21",
"react-is": "^16.10.2",
- "react-resize-detector": "^8.0.4",
- "react-smooth": "^2.0.2",
+ "react-smooth": "^4.0.0",
"recharts-scale": "^0.4.4",
- "reduce-css-calc": "^2.1.8",
+ "tiny-invariant": "^1.3.1",
"victory-vendor": "^36.6.8"
},
"engines": {
- "node": ">=12"
+ "node": ">=14"
},
"peerDependencies": {
- "prop-types": "^15.6.0",
"react": "^16.0.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
}
@@ -35493,6 +35454,14 @@
"decimal.js-light": "^2.4.1"
}
},
+ "node_modules/recharts/node_modules/clsx": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",
+ "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/redent": {
"version": "3.0.0",
"dev": true,
@@ -35551,18 +35520,6 @@
"integrity": "sha512-kxxKlPEDa6Nc5WJi+qRgPbOAbgTpSULL+vI3NUXsZMlkJxTqYI9wg5ZTay2sFrdZRWHPWNi+EdAhcJf81WtoMQ==",
"dev": true
},
- "node_modules/reduce-css-calc": {
- "version": "2.1.8",
- "license": "MIT",
- "dependencies": {
- "css-unit-converter": "^1.1.1",
- "postcss-value-parser": "^3.3.0"
- }
- },
- "node_modules/reduce-css-calc/node_modules/postcss-value-parser": {
- "version": "3.3.1",
- "license": "MIT"
- },
"node_modules/redux": {
"version": "4.2.1",
"license": "MIT",
@@ -43394,6 +43351,7 @@
"react-tooltip": "^4.2.17",
"react-use": "^17.5.0",
"reactflow": "^11.10.1",
+ "recharts": "^2.12.7",
"remark-gfm": "^3.0.1",
"sonner": "^1.5.0",
"sse.js": "^2.2.0",
diff --git a/packages/ui/index.tsx b/packages/ui/index.tsx
index 5f4f8464b69..a5815536c6a 100644
--- a/packages/ui/index.tsx
+++ b/packages/ui/index.tsx
@@ -13,7 +13,7 @@ export * from './src/components/Image'
// DISPLAYS
-export * from './src/components/Card'
+export { Card as Card_legacy_ } from './src/components/Card'
export * from './src/components/Tabs'
export * from './src/components/Alert'
export * from './src/components/Accordion'
@@ -93,14 +93,7 @@ export * from './src/components/shadcn/ui/toggle-group'
export { Toggle as Toggle_Shadcn_ } from './src/components/shadcn/ui/toggle'
-export {
- Card as Card_Shadcn_,
- CardContent as CardContent_Shadcn_,
- CardDescription as CardDescription_Shadcn_,
- CardFooter as CardFooter_Shadcn_,
- CardHeader as CardHeader_Shadcn_,
- CardTitle as CardTitle_Shadcn_,
-} from './src/components/shadcn/ui/card'
+export * from './src/components/shadcn/ui/card'
export {
Command as Command_Shadcn_,
@@ -259,6 +252,8 @@ export * from './src/components/radio-group-card'
export * from './src/components/TreeView'
+export * from './src/components/shadcn/ui/chart'
+
// links
export * from './src/components/TextLink'
diff --git a/packages/ui/package.json b/packages/ui/package.json
index fd55b1b9a06..642ef603946 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -81,6 +81,7 @@
"react-tooltip": "^4.2.17",
"react-use": "^17.5.0",
"reactflow": "^11.10.1",
+ "recharts": "^2.12.7",
"remark-gfm": "^3.0.1",
"sonner": "^1.5.0",
"sse.js": "^2.2.0",
diff --git a/packages/ui/src/components/shadcn/ui/chart.tsx b/packages/ui/src/components/shadcn/ui/chart.tsx
new file mode 100644
index 00000000000..f300d678f92
--- /dev/null
+++ b/packages/ui/src/components/shadcn/ui/chart.tsx
@@ -0,0 +1,325 @@
+import * as React from 'react'
+import * as RechartsPrimitive from 'recharts'
+
+import { cn } from '../../../lib/utils/cn'
+
+// Format: { THEME_NAME: CSS_SELECTOR }
+const THEMES = { light: '', dark: '.dark' } as const
+
+export type ChartConfig = {
+ [k in string]: {
+ label?: React.ReactNode
+ icon?: React.ComponentType
+ } & (
+ | { color?: string; theme?: never }
+ | { color?: never; theme: Record<keyof typeof THEMES, string> }
+ )
+}
+
+type ChartContextProps = {
+ config: ChartConfig
+}
+
+const ChartContext = React.createContext<ChartContextProps | null>(null)
+
+function useChart() {
+ const context = React.useContext(ChartContext)
+
+ if (!context) {
+ throw new Error('useChart must be used within a <ChartContainer />')
+ }
+
+ return context
+}
+
+const ChartContainer = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<'div'> & {
+ config: ChartConfig
+ children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children']
+ }
+>(({ id, className, children, config, ...props }, ref) => {
+ const uniqueId = React.useId()
+ const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`
+
+ return (
+ <ChartContext.Provider value={{ config }}>
+ <div
+ data-chart={chartId}
+ ref={ref}
+ className={cn(
+ "flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-foreground-muted [&_.recharts-cartesian-grid_line]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line-line]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",
+ className
+ )}
+ {...props}
+ >
+ <ChartStyle id={chartId} config={config} />
+ <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>
+ </div>
+ </ChartContext.Provider>
+ )
+})
+ChartContainer.displayName = 'Chart'
+
+const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
+ const colorConfig = Object.entries(config).filter(([_, config]) => config.theme || config.color)
+
+ if (!colorConfig.length) {
+ return null
+ }
+
+ return (
+ <style
+ dangerouslySetInnerHTML={{
+ __html: Object.entries(THEMES).map(
+ ([theme, prefix]) => `
+${prefix} [data-chart=${id}] {
+${colorConfig
+ .map(([key, itemConfig]) => {
+ const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || itemConfig.color
+ return color ? ` --color-${key}: ${color};` : null
+ })
+ .join('\n')}
+}
+`
+ ),
+ }}
+ />
+ )
+}
+
+const ChartTooltip = RechartsPrimitive.Tooltip
+
+const ChartTooltipContent = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
+ React.ComponentProps<'div'> & {
+ hideLabel?: boolean
+ hideIndicator?: boolean
+ indicator?: 'line' | 'dot' | 'dashed'
+ nameKey?: string
+ labelKey?: string
+ }
+>(
+ (
+ {
+ active,
+ payload,
+ className,
+ indicator = 'dot',
+ hideLabel = false,
+ hideIndicator = false,
+ label,
+ labelFormatter,
+ labelClassName,
+ formatter,
+ color,
+ nameKey,
+ labelKey,
+ },
+ ref
+ ) => {
+ const { config } = useChart()
+
+ const tooltipLabel = React.useMemo(() => {
+ if (hideLabel || !payload?.length) {
+ return null
+ }
+
+ const [item] = payload
+ const key = `${labelKey || item.dataKey || item.name || 'value'}`
+ const itemConfig = getPayloadConfigFromPayload(config, item, key)
+ const value =
+ !labelKey && typeof label === 'string'
+ ? config[label as keyof typeof config]?.label || label
+ : itemConfig?.label
+
+ if (labelFormatter) {
+ return (
+ <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>
+ )
+ }
+
+ if (!value) {
+ return null
+ }
+
+ return <div className={cn('font-medium', labelClassName)}>{value}</div>
+ }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey])
+
+ if (!active || !payload?.length) {
+ return null
+ }
+
+ const nestLabel = payload.length === 1 && indicator !== 'dot'
+
+ return (
+ <div
+ ref={ref}
+ className={cn(
+ 'grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg px-2.5 py-1.5 text-xs shadow-xl',
+ className
+ )}
+ >
+ {!nestLabel ? tooltipLabel : null}
+ <div className="grid gap-1.5">
+ {payload.map((item, index) => {
+ const key = `${nameKey || item.name || item.dataKey || 'value'}`
+ const itemConfig = getPayloadConfigFromPayload(config, item, key)
+ const indicatorColor = color || item.payload.fill || item.color
+
+ return (
+ <div
+ key={item.dataKey}
+ className={cn(
+ 'flex w-full items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-foreground-muted',
+ indicator === 'dot' && 'items-center'
+ )}
+ >
+ {formatter && item.value && item.name ? (
+ formatter(item.value, item.name, item, index, item.payload)
+ ) : (
+ <>
+ {itemConfig?.icon ? (
+ <itemConfig.icon />
+ ) : (
+ !hideIndicator && (
+ <div
+ className={cn(
+ 'shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]',
+ {
+ 'h-2.5 w-2.5': indicator === 'dot',
+ 'w-1': indicator === 'line',
+ 'w-0 border-[1.5px] border-dashed bg-transparent':
+ indicator === 'dashed',
+ 'my-0.5': nestLabel && indicator === 'dashed',
+ }
+ )}
+ style={
+ {
+ '--color-bg': indicatorColor,
+ '--color-border': indicatorColor,
+ } as React.CSSProperties
+ }
+ />
+ )
+ )}
+ <div
+ className={cn(
+ 'flex flex-1 justify-between leading-none',
+ nestLabel ? 'items-end' : 'items-center'
+ )}
+ >
+ <div className="grid gap-1.5">
+ {nestLabel ? tooltipLabel : null}
+ <span className="text-foreground-muted">
+ {itemConfig?.label || item.name}
+ </span>
+ </div>
+ {item.value && (
+ <span className="font-mono font-medium tabular-nums text-foreground">
+ {item.value.toLocaleString()}
+ </span>
+ )}
+ </div>
+ </>
+ )}
+ </div>
+ )
+ })}
+ </div>
+ </div>
+ )
+ }
+)
+ChartTooltipContent.displayName = 'ChartTooltip'
+
+const ChartLegend = RechartsPrimitive.Legend
+
+const ChartLegendContent = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<'div'> &
+ Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {
+ hideIcon?: boolean
+ nameKey?: string
+ }
+>(({ className, hideIcon = false, payload, verticalAlign = 'bottom', nameKey }, ref) => {
+ const { config } = useChart()
+
+ if (!payload?.length) {
+ return null
+ }
+
+ return (
+ <div
+ ref={ref}
+ className={cn(
+ 'flex items-center justify-center gap-4',
+ verticalAlign === 'top' ? 'pb-3' : 'pt-3',
+ className
+ )}
+ >
+ {payload.map((item) => {
+ const key = `${nameKey || item.dataKey || 'value'}`
+ const itemConfig = getPayloadConfigFromPayload(config, item, key)
+
+ return (
+ <div
+ key={item.value}
+ className={cn(
+ 'flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-foreground-muted'
+ )}
+ >
+ {itemConfig?.icon && !hideIcon ? (
+ <itemConfig.icon />
+ ) : (
+ <div
+ className="h-2 w-2 shrink-0 rounded-[2px]"
+ style={{
+ backgroundColor: item.color,
+ }}
+ />
+ )}
+ {itemConfig?.label}
+ </div>
+ )
+ })}
+ </div>
+ )
+})
+ChartLegendContent.displayName = 'ChartLegend'
+
+// Helper to extract item config from a payload.
+function getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {
+ if (typeof payload !== 'object' || payload === null) {
+ return undefined
+ }
+
+ const payloadPayload =
+ 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null
+ ? payload.payload
+ : undefined
+
+ let configLabelKey: string = key
+
+ if (key in payload && typeof payload[key as keyof typeof payload] === 'string') {
+ configLabelKey = payload[key as keyof typeof payload] as string
+ } else if (
+ payloadPayload &&
+ key in payloadPayload &&
+ typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'
+ ) {
+ configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string
+ }
+
+ return configLabelKey in config ? config[configLabelKey] : config[key as keyof typeof config]
+}
+
+export {
+ ChartContainer,
+ ChartTooltip,
+ ChartTooltipContent,
+ ChartLegend,
+ ChartLegendContent,
+ ChartStyle,
+}