Skip to content

Stat

The Stat component is designed for presenting individual statistics or key performance indicators (KPIs) in a clear and concise manner. It helps highlight important data points, making them easily digestible for users. It is composed of a main Stat wrapper and sub-components for its title, value, and description.

Add the Stat component and its sub-components to your project using the OrbitUI CLI:

Terminal window
npx orbitkit@latest add stat

Import the Stat, StatTitle, StatValue, and StatDescription components. Wrap your statistic content within the main Stat component, using StatTitle for the metric’s name, StatValue for its numerical or primary value, and StatDescription for any additional context.

Total users

12,345

Registered users this month

The Stat system consists of the following components, each with its own set of props:

The Stat component serves as the main container for a single statistic, ensuring proper layout and grouping of its sub-elements. This component accepts all the standard HTML attributes that a <div> element would.

The StatTitle component is used to display the name or label of the statistic. This component accepts all the standard HTML attributes that a <h3> element would.

The StatValue component displays the primary value of the statistic. This is typically a number, percentage, or other key metric. This component accepts all the standard HTML attributes that a <span> element would.

The StatDescription component provides additional context, a brief explanation, or a time frame for the statistic. This component accepts all the standard HTML attributes that a <p> element would.