Skip to content
synccn

Sparkline

Tiny trend line coloured by direction.

CORE

184.20+2.4%

GRID

62.05−1.1%

NODE

9.87+0.6%

Installation

$ pnpm dlx shadcn@latest add @synccn/sparkline

First 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[]

  • valuesrequired
    number[]

    Points to plot.

  • width
    number

    Default 96

    Width in pixels.

  • height
    number

    Default 28

    Height in pixels.

  • className
    string

    Extra 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

npm packages

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