---
title: Stat
description: "`Stat`は、数値やデータをボックス内に表示するために使用されます。"
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
```
## 使い方
```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`と`Stat.Icon`は、省略することができます。
:::
### サイズを変更する
```tsx
{(size, index) => (
8hr
18min
>
}
/>
)}
```
### カラースキームを変更する
```tsx
{(colorScheme, index) => (
)}
```
### コンテンツを中央寄せにする
コンテンツを中央寄せにする場合は、`centerContent`を`true`に設定します。
```tsx
```
### 単位を表示する
```tsx
Time to complete
8hr
18min
```
### 減少のアイコンを表示する
減少のアイコンを表示する場合は、`Stat.Icon`の`type`に`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. |
## アクセシビリティ
現在、v2の移行に伴い、このセクションは更新中です。