Controls

Lollipop Chart

Preview
Reduced motion

Simulates prefers-reduced-motion for the demo. Off follows your system setting.

Keyboard stepping

Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.

Lollipop Chart
  • This quarter
  • Last quarter

Satisfaction by team
teamThis quarterLast quarter
Design8270
Support9184
Sales7478
Product8872
Ops6961

Lollipop Chart

Thin stems topped with dots, a lighter take on the bar chart.

Installation

npx shadcn@latest add ikislay/pixel-ui/lollipop-chart

How to use

import { LollipopChart } from "@/components/ui/lollipop-chart"
const data = [
{ team: "Design", score: 82 },
{ team: "Support", score: 91 },
{ team: "Sales", score: 74 },
]
export function Demo() {
return (
<LollipopChart
label="Satisfaction by team"
data={data}
index="team"
series={[{ key: "score", label: "Score" }]}

Source Code

// Loading…

Props

Options you can pass to customize this component.

Prop
Type
Description
data*
Record<string, string | number>[]

One object per point along the x axis.

index*
string

The key in each object that labels the x axis.

series*
{ key: string; label?: string; color?: string }[]

The keys to plot. Colors follow the chart palette in order unless you set one.

label*
string

Names the chart for screen readers and captions its data table.

height
number

Height in pixels. The width fills the parent.

format
(value: number) => string

Formats values wherever the chart shows them. Defaults to short numbers like 12.4K.

className
string

Merged onto the root element.