Skip to main content

Statistic

Ant Design

The Statistic component is Ant Design's stat display. It shows one key figure, such as revenue or open tickets, with a title and an optional up or down trend.

Properties​

Property
Description
Expected Value
TitleLabel shown above the figure.Text. Default: Monthly revenue
ValueThe figure to show. A number is formatted by Formatter; text shows as it is.Text. Default: 48250
FormatterHow a number is written. auto keeps whole numbers whole and others to two decimals, percent reads 0.25 as 25%, and compact shortens large numbers to 12K or 1.2M.auto, number, currency, percent, compact. Default: auto
CurrencyCurrency code, such as USD or EUR, used when Formatter is currency.Text. Default: USD
LocaleLocale for number formatting, such as pt-BR. Leave it empty to follow the currency's usual format.Text
PrecisionNumber of decimal places. Leave it empty to use the format's own.Number
PrefixText shown before the figure, such as a unit.Text
SuffixText shown after the figure, such as orders or ms.Text
TrendDirection of the change. up and down add an arrow before Trend value.neutral, up, down. Default: neutral
Trend valueThe change shown under the figure, such as 12% or +340.Text
ExtraText shown after the trend, such as vs last month.Text
CardDraws the statistic inside a bordered card.On or off. Default: On

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off
Dynamic heightLets the component grow with its content in the running app instead of keeping a fixed height.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Set trendSets the trend direction to Trend (up, down or neutral) and, when given, the change to Trend value.components.statistic1.setTrend("up", "")
Set visibilityShows the component when true, hides it when false.components.statistic1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.statistic1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.statistic1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
titleLabel shown above the figure.{{components.statistic1.title}}
valueThe figure to show. A number is formatted by Formatter; text shows as it is.{{components.statistic1.value}}
formatterHow a number is written. auto keeps whole numbers whole and others to two decimals, percent reads 0.25 as 25%, and compact shortens large numbers to 12K or 1.2M.{{components.statistic1.formatter}}
currencyCurrency code, such as USD or EUR, used when Formatter is currency.{{components.statistic1.currency}}
localeLocale for number formatting, such as pt-BR. Leave it empty to follow the currency's usual format.{{components.statistic1.locale}}
precisionNumber of decimal places. Leave it empty to use the format's own.{{components.statistic1.precision}}
prefixText shown before the figure, such as a unit.{{components.statistic1.prefix}}
suffixText shown after the figure, such as orders or ms.{{components.statistic1.suffix}}
trendDirection of the change. up and down add an arrow before Trend value.{{components.statistic1.trend}}
trendValueThe change shown under the figure, such as 12% or +340.{{components.statistic1.trendValue}}
extraText shown after the trend, such as vs last month.{{components.statistic1.extra}}
borderedDraws the statistic inside a bordered card.{{components.statistic1.bordered}}
isVisibleWhether the component is visible.{{components.statistic1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.statistic1.isLoading}}
isDisabledWhether the component is disabled.{{components.statistic1.isDisabled}}

Styles​

Style
Default
Primary colorTheme: Brand primary
Text colorTheme: Primary text
Container backgroundTheme: Surface 1
Border colorTheme: Default border
Border radius—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.