Skip to Content
Documentation
Saas UI
Get Pro
Getting started
Components
Overview

Stat

Used to display a statistic with a title and value.

SourceStorybookRecipe
Unique visitors
192.1k

Anatomy

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

Examples

Format Options

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

Revenue
$935.40

Indicator

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

Unique visitors
192.1k
1.9%

Info Tip

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

Unique
192.1k

Value Unit

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

Time to complete
3 hr20 min

Progress Bar

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

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

Icon

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

Sales
$4.24k

Trend

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

Unique
$8,456.40
12%
since last month

Props

Root

PropDefaultType
colorPalette 'gray'
'gray' | 'zinc' | 'neutral' | 'stone' | 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'emerald' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose' | 'presence' | 'status' | 'sidebar' | 'sidebar.accent' | 'accent' | 'slate'

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