BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/acme/chart

chart

nrjdalal/chart
FreeComponent

acme publishes no description for this item.

Install it

npx shadcn@latest add https://nrjdalal.dev/r/chart.json

Source

src/components/ui/chart.tsxnrjdalal.dev/r/chart.json · first 6 KB
1"use client"
2
3import { cn } from "@/lib/utils"
4import * as React from "react"
5import * as RechartsPrimitive from "recharts"
6
7// Format: { THEME_NAME: CSS_SELECTOR }
8const THEMES = { light: "", dark: ".dark" } as const
9
10export type ChartConfig = {
11 [k in string]: {
12 label?: React.ReactNode
13 icon?: React.ComponentType
14 } & (
15 | { color?: string; theme?: never }
16 | { color?: never; theme: Record<keyof typeof THEMES, string> }
17 )
18}
19
20type ChartContextProps = {
21 config: ChartConfig
22}
23
24const ChartContext = React.createContext<ChartContextProps | null>(null)
25
26function useChart() {
27 const context = React.useContext(ChartContext)
28
29 if (!context) {
30 throw new Error("useChart must be used within a <ChartContainer />")
31 }
32
33 return context
34}
35
36function ChartContainer({
37 id,
38 className,
39 children,
40 config,
41 ...props
42}: React.ComponentProps<"div"> & {
43 config: ChartConfig
44 children: React.ComponentProps<
45 typeof RechartsPrimitive.ResponsiveContainer
46 >["children"]
47}) {
48 const uniqueId = React.useId()
49 const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`
50
51 return (
52 <ChartContext.Provider value={{ config }}>
53 <div
54 data-slot="chart"
55 data-chart={chartId}
56 className={cn(
57 "[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
58 className,
59 )}
60 {...props}
61 >
62 <ChartStyle id={chartId} config={config} />
63 <RechartsPrimitive.ResponsiveContainer>
64 {children}
65 </RechartsPrimitive.ResponsiveContainer>
66 </div>
67 </ChartContext.Provider>
68 )
69}
70
71const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
72 const colorConfig = Object.entries(config).filter(
73 ([, config]) => config.theme || config.color,
74 )
75
76 if (!colorConfig.length) {
77 return null
78 }
79
80 return (
81 <style
82 dangerouslySetInnerHTML={{
83// … truncated

What it pulls in

npm packages

  • clsx
  • react
  • recharts
  • tailwind-merge

Files it writes

  • src/components/ui/chart.tsx
  • src/lib/utils.ts

Facts

Registry
acme
Type
registry:ui
Access
Free
Files written
2
Licence
the repository states none
In the index
at or before 2026-08-13
Last confirmed
today

Go to the source

nrjdalal.dev nrjdalal/nrjdalal.com on GitHub Raw registry item This item as JSON

More from acme

All 49 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionacmeComponentsFree5 deps · 2 files
alertalertacmeComponentsFree4 deps · 2 files
alert-dialogalert-dialogacmeComponentsFree6 deps · 3 files
aspect-ratioaspect-ratioacmeComponentsFree1 dep
avataravataracmeComponentsFree4 deps · 2 files
badgebadgeacmeComponentsFree5 deps · 2 files
breadcrumbbreadcrumbacmeComponentsFree5 deps · 2 files
buttonbuttonacmeComponentsFree5 deps · 2 files

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored from measured facts

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex