Skip to Content
DocsResourcesShowcase

Stat

Used to display a statistic with a title and value.

SourceStorybookRecipe
Unique visitors
192.1k

import { Stat } from '@saas-ui/react/stat'
<Stat.Root>
  <Stat.Label />
  <Stat.ValueText />
  <Stat.HelpText>
    <Stat.UpIndicator />
    <Stat.DownIndicator />
  </Stat.HelpText>
</Stat.Root>

Pass the formatOptions to the StatValueText component to format the value.

Revenue
$935.40

Here's an example of how to display a statistic with an indicator.

Unique visitors
192.1k
1.9%

Pass the info prop to the StatLabel component to display an info tip.

Unique
192.1k

Here's an example of how to display a value with a unit.

Time to complete
3 hr20 min

Here's an example of how to display a statistic with a progress bar.

This week
$1,340
+12% from last week

Here's an example of how to display a statistic with an icon.

Sales
$4.24k

Here's an example of how to display a statistic with a trend indicator.

Unique
$8,456.40
12%
since last month

PropDefaultType
colorPalette 'gray'
'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'cyan' | 'purple' | 'pink' | 'accent'

The color palette of the component

size 'md'
'sm' | 'md' | 'lg'

The size of the component

as
React.ElementType

The underlying element to render.

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.
unstyled
boolean

Whether to remove the component's style.

Previous

Spinner

Next

Status