logo-icon
STW UI

Statistic

Statistic is used to show numbers and data in a box.

Usage

svelte
import { Statistic } from 'stwui';
// OR
import Statistic from 'stwui/statistic'; // for tree shaking

Basic

Total Likes
25.7M

With Icon

Total Likes
25.7M

With Progress

New Users
82.0K

With Comparison

Total Likes
25.7M
Last Year: 27.7M

With Trend

Page Views
$2.7M
Last Year: $2.6M
$80.0K (3%)

With Custom Colors

Page Views
$2.7M
Last Year: $2.6M
$80.0K (3%)

Statistic Props

bordered boolean true

Statistic Slots

title <Statistic.Title slot="title" />
icon <Statistic.Icon slot="icon" />
value <Statistic.Value slot="value" />
default
comparison <Statistic.Comparison slot="comparison" />
goal <Statistic.Goal slot="goal" />

Statistic.Title Slots

default

Statistic.Icon Props

data string (IconData)
viewBox string 0 0 24 24
size string 38px
width string 38px
height string 38px
color string currentColor
stroke string | undefined
fill string currentColor

Statistic.Value Slots

default

Statistic.Comparison Slots

value <Statistic.Comparison.Value slot="value" />
trend <Statistic.Comparison.Trend slot="trend" />

Statistic.Comparison.Value Slots

default

Statistic.Comparison.Trend Props

trend 'up' | 'down' | 'neutral' | undefined
showIcon boolean true

Statistic.Comparison.Trend.Slots Slots

icon <Statistic.Comparison.Trend.Icon slot="icon" />
default

Statistic.Comparison.Trend.Icon Props

data string (IconData)
viewBox string 0 0 24 24
size string 16px
width string 16px
height string 16px
color string currentColor
stroke string | undefined
fill string currentColor

Statistic.Goal Props

progress number

Statistic Class Identifiers

stwui-statistic
stwui-statistic-title-wrapper
stwui-statistic-title
stwui-statistic-icon
stwui-statistic-value
stwui-statistic-goal
stwui-statistic-comparison
stwui-statistic-comaprison-value
stwui-statistic-comparison-trend