BloksMoleculeIcon Stat

Icon Stat

Description

The Icon Stat component is a flexible and visually appealing way to present statistical information. It combines an optional icon with a numerical value, an optional suffix, and a descriptive title. This component is ideal for dashboards, summary sections, or anywhere you need to highlight key metrics with visual emphasis.

Installation

bash
sabaccui add iconStat

Usage

Here are some examples of how to use the Icon Stat component in a Storyblok block:

Basic usage with all fields

Preview

Users Icon
0 Active Users
+
Active Users

Usage without an icon

Preview

0 Uptime
%
Uptime

Usage with a large number

Preview

Revenue Icon
0 Annual Revenue
$
Annual Revenue

Schema

FieldTypeDescriptionDefault
iconassetAn optional icon to display alongside the stat.null
valuenumberThe numerical value of the statistic.null
suffixtextAn optional suffix to append to the value (e.g., "%", "+"). Translatable.""
titletextA descriptive title for the statistic. Translatable.""

Notes

  1. The component uses a NumberTicker component to animate the display of the numerical value.
  2. If no icon is provided, a vertical line will be displayed as a visual separator.
  3. The component is responsive and adjusts its layout for different screen sizes.
  4. The title is displayed in gray to differentiate it from the main value.

Best Practices:

  • Use concise and clear titles to explain what the statistic represents.
  • Choose appropriate icons that visually relate to the statistic being displayed.
  • Consider using suffixes to provide additional context or units for the values.
  • Ensure that the numerical values are kept up-to-date for accurate reporting.
  • Use this component in conjunction with other components to create informative dashboards or summary sections.