components
Tailwind CSS
Stat Stat is used to display key data and metrics in a clean and customizable layout.
This basic example of stat component.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Total Emails Sent
76,250
18% more than last month
The example below demonstrates a Stat displaying with avatar.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Total page views
89,400
21% ↗︎ than last month
The example below demonstrates a Stat displaying with icons and images.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Website Traffic
32K
5% ↗︎ than last week
New Signups
1.2K
12% increase this month
95%
Customer Retention
Steady over last quarter
The example below shows a Stat with a centered item layout.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Total Sales
52K
From Jan 1st to Feb 1st
Active Customers
8,350
↗︎ 150 (1.8%)
New Signups
2,400
↘︎ 180 (7%)
The example below illustrates a vertical Stat layout.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Total Invoices
5,780
From Jan 1st to Feb 1st
Paid Invoices
4,320
↗︎ 120 (3%)
Pending Invoices
1,460
↘︎ 80 (5%)
Use TailwindCSS classes for responsive design , 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.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Emails Sent
58K
Jan 1st to Feb 1st
New Subscribers
3,600
↗︎ 450 (14%)
Unsubscribes
850
↘︎ 65 (7%)
The example below shows a Stat with a progress bar.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Order
7,500 of 10,000 orders
Revenue
$45,000 of $100,000
Invoice
$18,200 of $25,000
The following example demonstrates the use of an action button within a stat component.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Subscription Plan
Premium
Upgrade Plan
Next Billing Date
Oct 15, 2024
View Details
Change Payment Method
The following example demonstrates a Stat component with a bordered layout.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Total Invoices
5,780
From Jan 1st - Feb 1st
Paid Invoices
4,320
↗︎ 120 (3%)
Pending Invoices
1,460
↘︎ 80 (5%)