Skip to content
Menu

Charts

Metric switch bar chart

Metric switch bar chart: A dense daily bar chart with two metric tiles in the header; clicking a tile morphs the bars over to that metric.

Using Metric switch bar chart

Metric switch bar chart uses the wide preview frame with a light/dark theme setting.

Customize the preview

These controls are passed to the demo. Defaults and limits describe the preview; consult the implementation for its full prop API.

ControlTypeDefaultPreview limits
accentColorcolor#FF6A1FNo additional limit in the metadata.
secondColorcolor#38BDF8No additional limit in the metadata.
daysnumber90From 30 to 120; step 10
defaultMetricselectvisitsOptions: visits, signups
animatebooleantrueNo additional limit in the metadata.
Which frameworks are available for Metric switch bar chart?

Metric switch bar chart is available for React, Vue, Svelte, Astro, HTML. The live preview uses React; the source observations below apply to index.tsx. Check the selected port before relying on the same interactions.

What does Metric switch bar chart depend on?

The React metadata lists these npm dependencies beyond React: motion, clsx, tailwind-merge.

What accessibility details are visible in Metric switch bar chart?

The React source for Metric switch bar chart includes: native elements (button); attributes and handlers (aria-hidden, aria-label, aria-pressed, onKeyDown, tabIndex); explicit roles (img); key comparisons (ArrowLeft, ArrowRight, End, Escape, Home). These are source observations. Verify accessible names, focus order and keyboard behavior in the composed page.

How does Metric switch bar chart handle reduced motion?

Metric switch bar chart reads the motion preference in its React source through useReducedMotion(). Preference-dependent expressions in index.tsx: barTransition: reduce || !animate ? { duration: 0 } : { duration: 0.55, ease: [0.22, 1, 0.36, 1] }; reduce ? { duration: 0 } : { type: "spring", stiffness: 380, damping: 36 }. Check the full implementation, shared styles and selected port with reduced motion enabled; these observations do not establish that every animation stops.

Connect your agent

Related open components