Skip to content

Stat

marimo.stat

stat(
    value: str | int | float,
    label: str | None = None,
    caption: str | None = None,
    direction: Literal["increase", "decrease"]
    | None = None,
    bordered: bool = False,
    target_direction: Literal["increase", "decrease"]
    | None = "increase",
) -> Html

Display a statistic.

Optionally include a label, caption, and direction.

PARAMETER DESCRIPTION
value

the value to display

TYPE: str | int | float

label

the label to display

TYPE: str | None DEFAULT: None

caption

the caption to display

TYPE: str | None DEFAULT: None

direction

the direction of the statistic, either increase or decrease

TYPE: Literal['increase', 'decrease'] | None DEFAULT: None

bordered

whether to display a border around the statistic

TYPE: bool DEFAULT: False

target_direction

the direction of the statistic corresponding to a positive or desirable outcome. Set to increase when higher values are better, or decrease when lower values are better. By default the target direction is increase.

TYPE: Literal['increase', 'decrease'] | None DEFAULT: 'increase'

RETURNS DESCRIPTION
Html

An Html object representing the statistic.