Krizaka UI
Krizaka UI
ComponentsData display

Charts provider

The locale, the brand palette and the words of every chart below it, set once; plus the sliding window for live data.

Web · ✓Mobile · ✓Desktop · ✓BetaCharts
Support level
Beta
Size
Not measured
Who uses it
No live product imports it yet
import { ChartsProvider, useSlidingWindow } from "@krizaka/charts/provider";

Web and mobile — the same component for React and React Native. Beta: its API may still change in a minor version.

Why it is here. Used by Sovkora.

When to use

  • Once near the root of an app: its locale (fr-FR), its brand (sovkora), its translated words.
  • An app that loads a brand stylesheet on :root rather than a .brand-<id> class: set brand here.

When not to use

  • To change one chart only: every chart takes locale, brand and labels itself.Use instead: Line chart

Installation

Install

npm install @krizaka/charts

Import

import { ChartsProvider, useSlidingWindow } from "@krizaka/charts/provider";

Examples

French, Sovkora

Figures and dates in French, the Sovkora palette, the words translated.

Props

Sets the locale, the brand and the words of every chart below it.

PropTypeDefaultDescription
brandBrandId—The brand whose palette the charts use. Without it, a chart follows a .brand-<id> ancestor, else Krizaka. Set it when the app loads a brand stylesheet on :root (@krizaka/tokens/brands/sovkora.css).
labelsChartLabelsInput—The words, translated: the buttons, the states, the written summary.
localeLocale—The locale of every figure and date ("fr-FR"). Default "en-US".

Accessibility

  • The words it sets are what screen readers hear: the summary, the role description, the keyboard hint.

Best practices

  • Translate labels from the app's catalogue; the summary templates take {placeholders}.
  • In React Native, pass scheme and theme from @krizaka/ui/native's useTheme() so the charts follow the app's theme and brand.

Generated from the code of @krizaka/ui 5.3.4: its meta.ts, its examples and its types.Edit this documentation on GitHub

On this page