Stat

A component for displaying statistics with labels, values, and trend indicators.

Anatomy

<script>
  import { Stat } from "@saas-ui/svelte/components/stat";
</script>

<Stat.Root>
  <Stat.Label>Total Revenue</Stat.Label>
  <Stat.ValueText>$45,000</Stat.ValueText>
  <Stat.HelpText>
    <Stat.UpTrend>12%</Stat.UpTrend>
  </Stat.HelpText>
</Stat.Root>

Examples

Basic Accessibility

Basic stat with label and value.

Colours Accessibility

Use the colour prop on trend indicators.

Format Options Accessibility

Use formatOptions to format the value as currency, percentage, etc.

Icon Accessibility

Add icons to the stat label.

Indicator Accessibility

Use Stat.DownTrend or Stat.UpTrend to show change indicators.

Progress Bar Accessibility

Combine stat with a progress bar for visual representation.

Trend Accessibility

Show trend with value, percentage, and help text.

Value Unit Accessibility

Use Stat.ValueUnit to add units to the value.

Props

Prop Type Default Description
class text - CSS class to apply to the component.