Components

Stat

Display key metrics with Semji's stat component. Use Tailwind CSS for clean, customizable data displays in web projects.

Basic example

Default

This basic example of stat component.

Total Emails Sent
76,250
18% more than last month

Illustration

With avatar

The example below demonstrates a Stat displaying with avatar.

User Avatar
Total page views
89,400
21% ↗︎ than last month

With icons and image

The example below demonstrates a Stat displaying with icons and images.

Website Traffic
32K
5% ↗︎ than last week
New Signups
1.2K
12% increase this month
User Avatar
95%
Customer Retention
Steady over last quarter

Center item

The example below shows a Stat with a centered item layout.

Total Sales
52K
From Jan 1st to Feb 1st
Active Customers
8,350
↗︎ 150 (1.8%)
New Signups
2,400
↘︎ 180 (7%)

Vertical

The example below illustrates a vertical Stat layout.

Total Invoices
5,780
From Jan 1st to Feb 1st
Paid Invoices
4,320
↗︎ 120 (3%)
Pending Invoices
1,460
↘︎ 80 (5%)

Responsive

Use TailwindCSS classes for <a href="https://tailwindcss.com/docs/responsive-design#targeting-a-breakpoint-range" target="_blank" class="link link-primary">responsive design</a>, such as `sm:`, `md:`, `lg:`, `xl:`, and `2xl:`, along with the responsive class `stats-vertical`, to switch the stat alignment to horizontal at specific breakpoints or vice the versa.

Emails Sent
58K
Jan 1st to Feb 1st
New Subscribers
3,600
↗︎ 450 (14%)
Unsubscribes
850
↘︎ 65 (7%)

With progress bar

The example below shows a Stat with a progress bar.

Order
7,500 of 10,000 orders
Revenue
$45,000 of $100,000
Invoice
$18,200 of $25,000

With actions button

The following example demonstrates the use of an action button within a stat component.

Subscription Plan
Premium
Next Billing Date
Oct 15, 2024

Border layout

The following example demonstrates a Stat component with a bordered layout using `stats-border`.

Total Invoices
5,780
From Jan 1st - Feb 1st
Paid Invoices
4,320
↗︎ 120 (3%)
Pending Invoices
1,460
↘︎ 80 (5%)
Class referenceThe component, style, color, state, size and modifier classes available for this component.
ClassTypeDescription
statscomponentA container that holds multiple stat items.
statpartRepresents an individual stat item.
stat-titlepartDisplays the title text for a stat item.
stat-valuepartShows the numerical or main value of a stat item.
stat-descpartProvides additional description text for a stat item.
stat-figurepartUsed for displaying an icon, image, or other graphic element.
stat-actionspartContains buttons or input fields related to the stat item.
stats-borderstyleApplies a border to the stat.
stats-horizontaldirectionArranges stat items in a horizontal layout (default).
stats-verticaldirectionArranges stat items in a vertical layout.