area-chart-kpi-02
dashboardblocks/area-chart-kpi-02FreeComponent
dashboardblocks publishes no description for this item.
Install it
npx shadcn@latest add https://dashboardblocks.com/r/area-chart-kpi-02.jsonSource
1'use client'23import {4 TinyAreaChart,5 ValueFormatter,6} from '@/registry/components/dashboardblocks/chart'7import { KPI, KPIContent, KPIValue } from '@/registry/components/dashboardblocks/kpi'8import { Trend } from '@/registry/components/dashboardblocks/trend'9import { AreaProps } from 'recharts'1011import { CardDescription, CardTitle } from '@/components/ui/card'1213interface AreaChartKPI2Props {14 trend: number15 data: unknown[]16 description: string17 formatter?: ValueFormatter18 height: number19 areas: AreaProps[]20 title: string21 value: number22}2324const exampleProps: AreaChartKPI2Props = {25 trend: 18.4,26 data: [27 {28 label: 'Monday',29 value: 4200,30 },31 {32 label: 'Tuesday',33 value: 5100,34 },35 {36 label: 'Wednesday',37 value: 2800,38 },39 {40 label: 'Thursday',41 value: 5600,42 },43 {44 label: 'Friday',45 value: 6300,46 },47 {48 label: 'Saturday',49 value: 5400,50 },51 {52 label: 'Sunday',53 value: 6900,54 },55 ],56 description: '+23.8K this week',57 formatter: (value) => `$${value.toLocaleString()}`,58 height: 160,59 areas: [60 {61 dataKey: 'value',62 fill: 'var(--color-chart-2)',63 stroke: 'var(--color-chart-2)',64 },65 ],66 title: 'Total Transactions',67 value: 128400,68}6970const AreaChartKPI2 = (props: AreaChartKPI2Props) => {71 const { trend, data, description, formatter, height, areas, title, value } = props72 return (73 <KPI className='relative overflow-hidden'>74 <KPIContent>75 <div className='relative z-10 space-y-12'>76 <div className='flex items-center justify-between'>77 <CardTitle>{title}</CardTitle>78 <Trend trend={trend} variant='badge' />79 </div>80 <div className='space-y-1'>81 <KPIValue value={value} formatter={formatter} animated />82 <CardDescription className='text-foreground'>{description}</CardDescription>83 </div>84 </div>85 <div className='absolute -bottom-4 -left-4 opacity-75 pointer-events-none w-[calc(100%+2rem)]'>86 <TinyAreaChart87 data={data}88 areas={areas}89 formatter={formatter}90 height={height}91 />92 </div>93 </KPIContent>94 </KPI>95 )96}9798export {99 AreaChartKPI2,100 exampleProps as areaChartKpi2ExampleProps,101 type AreaChartKPI2Props,102}
What it pulls in
Other registry items
Files it writes
More from dashboardblocks
All 36 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Activity Feedactivity-feed | dashboardblocks | Components | Free | 1 dep | |
| activity-feed-01activity-feed-01 | dashboardblocks | Components | Free | 1 dep | |
| activity-feed-02activity-feed-02 | dashboardblocks | Components | Free | 1 dep | |
| activity-feed-03activity-feed-03 | dashboardblocks | Components | Free | 1 dep | |
| activity-feed-04activity-feed-04 | dashboardblocks | Components | Free | 1 dep | |
| activity-feed-05activity-feed-05 | dashboardblocks | Components | Free | 1 dep | |
| Animated Numberanimated-number | dashboardblocks | Components | Free | no deps | |
| Animated Waveanimated-wave | dashboardblocks | Components | Free | no deps |
