--- title: Stat description: "`Stat` is used to display numbers or data within a box." links: - style: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/components/stat/stat.style.ts - source: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/components/stat - storybook: https://yamada-ui.github.io/yamada-ui?path=/story/components-stat--basic --- ```tsx Total Page Views 1,993,818 21% more than last month ``` ## Usage ```tsx import { Stat } from "@yamada-ui/react" ``` ```tsx import { Stat } from "@/components/ui" ``` ```tsx import { Stat } from "@workspaces/ui" ``` ```tsx ``` :::note `Stat.Label`, `Stat.Value`, `Stat.HelperMessage`, and `Stat.Icon` can be omitted. ::: ### Change Size ```tsx {(size, index) => ( 8hr 18min } /> )} ``` ### Change Color Scheme ```tsx {(colorScheme, index) => ( )} ``` ### Center Content To center the content, set `centerContent` to `true`. ```tsx ``` ### Display Unit ```tsx Time to complete 8hr 18min ``` ### Display Decrease Icon To display a decrease icon, set the `type` of `Stat.Icon` to `decrease`. ```tsx Total Page Views 1,993,818 21% more than last month ``` ## Props ### Stat.Root | Prop | Default | Type | Description | | -------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | | `size` | `"md"` | `"lg" \| "md" \| "sm" \| "xs"` | The size of the component. | | `centerContent` | `false` | `boolean` | If `true`, container will center its children regardless of their width. | | `helperMessage` | - | `ReactNode` | The stat helper message to use. | | `helperMessageProps` | - | `StatHelperMessageProps` | Props for stat helper message component. | | `icon` | - | `StatIconProps["type"]` | The stat icon to use. | | `iconProps` | - | `Omit` | Props for stat icon component. | | `label` | - | `ReactNode` | The stat label to use. | | `labelProps` | - | `StatLabelProps` | Props for stat label component. | | `value` | - | `ReactNode` | The stat value to use. | | `valueProps` | - | `StatValueProps` | Props for stat value component. | ### Stat.HelperMessage | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ### Stat.Icon | Prop | Default | Type | Description | | ------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | | `type` | `"increase"` | `"decrease" \| "increase"` | The type of the icon. | ### Stat.Label | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ### Stat.Unit | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ### Stat.Value | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ## Accessibility Currently, this section is being updated due to the migration of v2.