components

Tailwind CSS Stat

Stat is used to display key data and metrics in a clean and customizable layout.

Class Name
Type
Description
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.

This basic example of stat component.

The example below demonstrates a Stat displaying with avatar.

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

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

The example below illustrates a vertical Stat layout.

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.

The example below shows a Stat with a progress bar.

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

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