Displays related numbers and supporting data in composable horizontal, vertical, or responsive blocks.
Preview
Total page views
89,400
21% more than last month
stat.demo.svelte
<scriptlang="ts">import*as Stat from'$lib/components/ui/stat';</script><Stat.Rootclass="border border-border shadow-sm"> <Stat.Item> <Stat.Title>Total page views</Stat.Title> <Stat.Value>89,400</Stat.Value> <Stat.Description>21% more than last month</Stat.Description> </Stat.Item></Stat.Root>
More examples
Responsive dashboard
Combine figures, semantic colors, and multiple values in a layout that stacks on smaller screens.
Compose Root, Item, Title, Value, and Description. Add Figure for an icon or image and Actions for controls. Root defaults to a horizontal layout; use vertical or responsive when the stats should stack, including on smaller screens.
API reference
Prop
Type
Default
Description
Root.direction
horizontal | vertical | responsive
horizontal
Sets the horizontal or vertical layout direction.
class
string
—
Tailwind CSS classes applied to the component root.
children
Snippet
required
Content rendered inside the component.
Source
These files are included in the registry item and copied into the consuming project.
import Root from'./stat.svelte';import Item from'./stat-item.svelte';import Title from'./stat-title.svelte';import Value from'./stat-value.svelte';import Description from'./stat-description.svelte';import Figure from'./stat-figure.svelte';import Actions from'./stat-actions.svelte';export { Root, Item, Title, Value, Description, Figure, Actions };export { Root as Stat, Item as StatItem, Title as StatTitle, Value as StatValue, Description as StatDescription, Figure as StatFigure, Actions as StatActions};exporttype { StatDirection } from'./stat.svelte';