Flutter docs
Default skin

Statistic

Display statistic number.

When to use

  • When want to highlight some data.
  • When want to display statistic data with description.

Examples

Basic

Simplest Usage.

Animated number

Animated number with react-countup.

Timer

Timer component.

Unit

Add unit through prefix and suffix.

In Card

Display statistic data in Card.

Custom semantic dom styling

You can customize the semantic dom style of the Statistic by passing objects/functions through classNames and styles.

API

Statistic, Statistic.Timer, and Statistic.Countdown are exported from @ceebee/ui/client.

Statistic

PropertyDescriptionTypeDefaultVersion
classNamesCustomize class for each semantic structure inside the Statistic component. Supports object or function.Record<SemanticDOM, string> | (info: { props }) => Record<SemanticDOM, string>-—
decimalSeparatorThe decimal separatorstring.—
formatterCustomize value display logic(value) => ReactNode-—
groupSeparatorGroup separatorstring,—
loadingLoading status of Statisticbooleanfalse4.8.0
precisionThe precision of input valuenumber-—
prefixThe prefix node of valueReactNode-—
stylesCustomize inline style for each semantic structure inside the Statistic component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props }) => Record<SemanticDOM, CSSProperties>-—
suffixThe suffix node of valueReactNode-—
titleDisplay titleReactNode-—
valueDisplay valuestring | number-—
valueStyleSet value section style, please use styles.content insteadCSSProperties-—
formatFormat as dayjsstringHH:mm:ss—
prefixThe prefix node of valueReactNode-—
suffixThe suffix node of valueReactNode-—
titleDisplay titleReactNode-—
valueSet target countdown timenumber-—
valueStyleSet value section styleCSSProperties-—
onFinishTrigger when time's up() => void-—
onChangeTrigger when time's changing(value: number) => void-4.16.0
typeTimer direction, count down or count upcountdown | countup-—
formatFormat as dayjsstringHH:mm:ss—
prefixThe prefix node of valueReactNode-—
suffixThe suffix node of valueReactNode-—
titleDisplay titleReactNode-—
valueTarget time for countdown, or start time for countup (timestamp in ms)number-—
valueStyleSet value section styleCSSProperties-—
onFinishTrigger when time's up, only called when type is countdown() => void-—
onChangeTrigger when time's changing(value: number) => void-—