Skip to content

components/Progress

import { … } from 'zidane-ui'ui/src/components/Progress.tsx

Components#

ProgressComponent#

Renders the count, its line and the bar.

TypeScript
function Progress(props: ProgressProps): Element
Parameters
NameTypeDescription
propsProgressProps

ProgressProps.

Element
Progress props
NameTypeDefaultDescription
className?string

Extra classes on the root element.

format?(value: number) => string

Formats a value. Default: the number in full, up to two decimals.

label?ReactNode

What is measured, before the numbers. Also the bar's accessible name.

max?number100

The goal.

size?'stat' | 'headline''stat'

headline: the count at the figure step, for the one number that answers a view.

style?CSSProperties

Inline styles on the root element.

threshold?number

The level the value should reach. Under it, the bar takes tone; a tick marks it on the track.

tone?ProgressTone'neutral'

The bar's color under threshold. neutral is the accent; a full bar is the success color. warning and danger need a threshold: a tone with no rule is not drawn.

unit?string

The values' unit (see withUnit).

valuenumber

How far, from 0.

ui/src/components/Progress.tsx:78

Functions#

progressShareFunction#

The share of max that value is, from 0 to 1.

TypeScript
function progressShare(value: number, max: number): number
Parameters
NameTypeDescription
valuenumber

How far.

maxnumber

The goal.

number

ui/src/components/Progress.tsx:50

Interfaces#

ProgressPropsInterface#

Props for Progress.

TypeScript
interface ProgressProps
ProgressProps properties
NameTypeDefaultDescription
className?string

Extra classes on the root element.

format?(value: number) => string

Formats a value. Default: the number in full, up to two decimals.

label?ReactNode

What is measured, before the numbers. Also the bar's accessible name.

max?number100

The goal.

size?'stat' | 'headline''stat'

headline: the count at the figure step, for the one number that answers a view.

style?CSSProperties

Inline styles on the root element.

threshold?number

The level the value should reach. Under it, the bar takes tone; a tick marks it on the track.

tone?ProgressTone'neutral'

The bar's color under threshold. neutral is the accent; a full bar is the success color. warning and danger need a threshold: a tone with no rule is not drawn.

unit?string

The values' unit (see withUnit).

valuenumber

How far, from 0.

ui/src/components/Progress.tsx:17

Types#

ProgressToneType#

The color of a Progress bar.

TypeScript
type ProgressTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger'

ui/src/components/Progress.tsx:14