CORE
184.20+2.4%
GRID
62.05−1.1%
NODE
9.87+0.6%
Installation
$ pnpm dlx shadcn@latest add @synccn/sparklineFirst time in this project? Connect synccn with one command.
Usage
import { Sparkline } from "@/components/ui/charts";<Sparkline values={[3, 5, 4, 8]} />API reference
Generated from the component's TypeScript types, so it always matches the code.
Sparkline
Tiny inline trend line. values: number[]
PropTypeDescription
- valuesrequired
number[]Points to plot.
- width
numberDefault
96Width in pixels.
- height
numberDefault
28Height in pixels.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA roles: img, meter
- ARIA attributes: aria-label, aria-pressed, aria-valuemax, aria-valuemin, aria-valuenow
More data
Data TableSorting, search, column visibility, selection and paging.Bar ChartResponsive SVG bars with tooltips and an entrance.Area ChartSmooth area with a crosshair tooltip.HeatmapContribution-style calendar of daily counts.KanbanDrag cards between columns.Sortable ListDrag to reorder, with Alt+arrow keyboard support.