Interactive example
Daily price rangeSynthetic prices in USD
  • Rising, hollow body
  • Falling, filled body
37.742.44751.656.3Mon. Open $42.00, high $48.00, low $39.00, close $46.00. Rising.MonTue. Open $46.00, high $51.00, low $44.00, close $49.00. Rising.TueWed. Open $49.00, high $50.00, low $43.00, close $45.00. Falling.WedThu. Open $45.00, high $53.00, low $44.00, close $51.00. Rising.ThuFri. Open $51.00, high $55.00, low $48.00, close $53.00. Rising.FriSat. Open $53.00, high $54.00, low $47.00, close $49.00. Falling.Sat
Use arrow keys to select a data point. Home selects the first point and End selects the last. Escape closes the value tooltip.
Mon
Open
$42.00
High
$48.00
Low
$39.00
Close
$46.00
View data table 6 rows
Daily price range
Data pointOpenHighLowClose
Mon$42.00$48.00$39.00$46.00
Tue$46.00$51.00$44.00$49.00
Wed$49.00$50.00$43.00$45.00
Thu$45.00$53.00$44.00$51.00
Fri$51.00$55.00$48.00$53.00
Sat$53.00$54.00$47.00$49.00

Installation

terminal
bunx --bun shadcn@latest add https://apple-ui-eduardo.vercel.app/r/candlestick-chart.json

The registry includes the shared styles and dependencies. Import @/components/apple-ui/styles.css in your root layout once. For the package route, use the installation guide.

Usage

tsx
"use client";

import { CandlestickChart } from "@eduardoul/apple-ui";

const data = [
  { label: "Mon", open: 42, high: 48, low: 39, close: 46 },
  { label: "Tue", open: 46, high: 51, low: 44, close: 49 },
  { label: "Wed", open: 49, high: 50, low: 43, close: 45 },
  { label: "Thu", open: 45, high: 53, low: 44, close: 51 },
];

export function Example() {
  return (
    <CandlestickChart
      title="Daily price range"
      description="Synthetic prices in USD"
      data={data}
      valueFormatter={(value) => "$" + value.toFixed(2)}
    />
  );
}

Package imports use @eduardoul/apple-ui. Registry imports use @/components/apple-ui. Add "use client" to files that use state or event handlers.

API reference

PropertyTypeDefault
dataCandlestickDatum[]required
titlestringrequired
descriptionstringundefined
heightnumbercomponent default
loadingbooleanfalse
errorstringundefined
emptyMessagestringNo data to display.
showTablebooleantrue
compactbooleanfalse
valueFormatter(value: number) => stringlocalized number
classNamestringundefined
styleReact.CSSPropertiesundefined

Use className and style to customize the component. The package includes full TypeScript definitions for its supported element properties and refs.

Design guidance

  • Use candlesticks only when open, high, low, and close values all matter.
  • Keep intervals evenly ordered and state the unit in the title, description, or formatter.
  • Explain the rising and falling color convention near the chart. Do not rely on color alone.
Read Apple’s guidance

Accessibility

Give the chart a descriptive title and explain its units. Select a data point to read its values, or open the data table for the full dataset. Labels and values accompany color, and the chart adapts to reduced motion and appearance preferences. Test long labels, touch input and keyboard navigation with your own data.

Library styles support reduced motion, reduced transparency, increased contrast and forced colors. Read the accessibility foundation for the checks your application still needs.