Magoo Component UI logo Magoo Component UI
← Catalog

Crypto Price Chart

price-chart-crypto organism experimental

A candlestick price chart card with a segmented time-range selector.

Also in: Cards

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default

BTC / USD

Weekly

ETH / USD

Props

NameTypeReq
title string ✓
candles array ✓
ranges array ✓

Related components

How to use

behavior.js targets the .price-chart-crypto__range tab buttons. On click it sets data-active / aria-selected across the tabs (data-[active=true]: utilities restyle the active chip) and dispatches a bubbling "range:change" CustomEvent whose detail is { label } (e.g. "1W"). Listen on the component root or an ancestor, fetch that range's OHLC series, recompute the candle percentages, and re-render. The candle colours come from data-up plus data-[up=true]:stroke-success / data-[up=false]:stroke-danger, so no JS touches them. The init returns a cleanup function that removes every listener.

Use cases

chartcard WCAG AA SEO 35 dir: both ai-generated