0.7.2

WidgetStats

Source code

The Stats component is a comprehensive widget for showcasing statistical data with a headline, tagline, and customizable call-to-action. It is ideal for presenting multiple key metrics in a visually structured and accessible way.

Tagline

Title

Subtitle

132K
Downloads
24.8K
Stars
10.3K
Forks
48.4K
Users
---
import { WidgetStats } from '@yatoday/astro-ui/astro';
---

<WidgetStats
  title="Title"
  subtitle="Subtitle"
  tagline="Tagline"
  items={[
    { title: '132K', description: 'Downloads' },
    { title: '24.8K', description: 'Stars' },
    { title: '10.3K', description: 'Forks' },
    { title: '48.4K', description: 'Users' },
  ]}
  callToAction={{
    text: 'Read all',
    href: '/',
    icon: 'tabler:chevron-right',
  }}
/>

Props

PropTypeDefaultDescription
titlestring-Title in Headline component
subtitlestring-Subtitle in Headline component
taglinestring-Tagline in Headline component
callToActionToAction | string | ToAction[] | string[]-Action button or link. See the ToAction for details.
itemsArray[]Array of Stat items. Type here.
isAfterContentbooleanfalse-
idstring-Specify a unique id for the section
isDarkbooleanfalseAdds the dark CSS class to the WidgetWrapper
bgstring-Set background element
classes.containerstring-CSS classes for the root container
classes.headline.{...}string-CSS classes for the Headline component
classes.items.{...}Object-CSS classes for the Stats 0 component