logoAnt Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
YouMindTRACTIANLobeHubCodeRabbit
6.4.5
  • Components Overview
  • Changelog
    v6.4.5
  • General
    • Button
    • FloatButton
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
    • Grid
    • Layout
    • Masonry
      6.0.0
    • Space
    • Splitter
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
    • Tabs
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPicker
    • DatePicker
    • Form
    • Input
    • InputNumber
    • Mentions
    • Radio
    • Rate
    • Select
    • Slider
    • Switch
    • TimePicker
    • Transfer
    • TreeSelect
    • Upload
  • Data Display
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Collapse
    • Descriptions
    • Empty
    • Image
    • List
      DEPRECATED
    • Popover
    • QRCode
    • Segmented
    • Statistic
    • Table
    • Tag
    • Timeline
    • Tooltip
    • Tour
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
  • Other
    • Affix
    • App
    • BorderBeam
      6.4.0
    • ConfigProvider
    • Util
When To Use
Examples
Basic
Unit
Animated number
In Card
Timer
Custom semantic dom styling
API
Semantic DOM
Design Token

Statistic

Display statistic number.
Importimport { Statistic } from 'antd';
GitHub
components/statisticIssueOpen issues
Docs
Edit this pageLLMs.md
SegmentedTable

Resources

Ant Design X
Ant Design Charts
Ant Design Pro
Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Web3
Ant Design Landing-Landing Templates
Scaffolds-Scaffold Market
Umi-React Application Framework
dumi-Component doc generator
qiankun-Micro-Frontends Framework
Ant Motion-Motion Solution
China Mirror 🇨🇳

Community

Awesome Ant Design
Medium
X
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference

Help

GitHub
Change Log
FAQ
For Agents
Bug Report
Issues
Discussions
StackOverflow
SegmentFault

Ant XTech logoMore Products

yuque logoYuQue-Document Collaboration Platform
AntV logoAntV-Data Visualization
Egg logoEgg-Enterprise Node.js Framework
Kitchen logoKitchen-Sketch Toolkit
Galacean logoGalacean-Interactive Graphics Solution
WeaveFox logoWeaveFox-AI Development with WeaveFox 🦊
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community
loading

When To Use

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

Examples

API

Common props ref:Common props

Statistic

PropertyDescriptionTypeDefaultVersionGlobal Config
classNamesCustomize class for each semantic structure inside the Statistic component. Supports object or function.Record<SemanticDOM, string> | (info: { props }) => Record<SemanticDOM, string>-6.0.0
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>-6.0.0
suffixThe suffix node of valueReactNode-×
titleDisplay titleReactNode-×
valueDisplay valuestring | number-×
valueStyleSet value section style, please use styles.content insteadCSSProperties-×

Statistic.Countdown Deprecated

When using version >= 5.25.0, Please use Statistic.Timer instead.
PropertyDescriptionTypeDefaultVersion
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

Statistic.Timer 5.25.0+

PropertyDescriptionTypeDefaultVersion
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-

Semantic DOM

Statistic supports root, header, title, content, value, prefix, and suffix semantic DOM nodes.

Design Token

Component TokenHow to use?
Token NameDescriptionTypeDefault Value
contentFontSizeContent font sizestring | number24
titleFontSizeTitle font sizenumber14
Global TokenHow to use?
Token NameDescriptionTypeDefault Value
colorTextDefault text color which comply with W3C standards, and this color is also the darkest neutral color.stringrgba(0,0,0,0.88)
colorTextDescriptionControl the font color of text description.stringrgba(0,0,0,0.45)
colorTextHeadingControl the font color of heading.stringrgba(0,0,0,0.88)
fontFamilyThe font family of Ant Design prioritizes the default interface font of the system, and provides a set of alternative font libraries that are suitable for screen display to maintain the readability and readability of the font under different platforms and browsers, reflecting the friendly, stable and professional characteristics.string-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'
fontSizeThe most widely used font size in the design system, from which the text gradient will be derived.number14
lineHeightLine height of text.number1.5714285714285714
marginXXSControl the margin of an element, with the smallest size.number4
paddingControl the padding of the element.number16
Basic

Simplest Usage.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Animated number

Animated number with react-countup.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Timer

Timer component.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
5.25.0
Unit

Add unit through prefix and suffix.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
In Card

Display statistic data in Card.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Custom semantic dom styling

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

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
6.0.0
Active Users
112,893
Account Balance (CNY)
112,893.00
Active Users

Active Users
Account Balance (CNY)
-
Million Seconds
-
Countdown
-
Countup
-
Day Level (Countdown)
-
Day Level (Countup)
-
Feedback
1,128
Unmerged
93/ 100
Active
11.28%
Idle
9.30%
Monthly Active Users
93,241users
Yearly Loss
-18.7%
Active
11.28%
  • root
    6.0.0
    Root element with reset styles and overall container styles for statistic component
  • header
    6.0.0
    Header element with bottom padding and title area layout styles
  • title
    6.0.0
    Title element with text color, font size and other title text display styles
  • prefix
    6.0.0
    Prefix element with inline-block display, right margin and other prefix content layout styles
  • content
    6.0.0
    Content element with layout and alignment styles for the prefix, value and suffix area
  • value
    6.4.0
    Value element with text color, font size, font family and other statistic number display styles
  • suffix
    6.0.0
    Suffix element with inline-block display, left margin and other suffix content layout styles