MetricItem
MetricItemOne useful number Make an important number stand out, with a clear label and the context readers need.
Landing & pricingA value with context
MetricItem puts the value first visually, with a label above it and supporting detail below. Use it for a product statistic, a project snapshot, or a short status. An optional icon helps readers recognize the subject at a glance.
Include units, time periods, or the source of a measurement in the content. These illustrative examples show two different kinds of value inside Panel.
Preview build
Local preview of a sample project.
Availability
Example service over the last 30 days.
A prominent value, a readable label, and just enough context. These are illustrative measurements.
<Grid columns="1" columnsMd="2" class="gap-5">
<Panel tone="neutral" variant="surface" class="p-5">
<MetricItem
label="Preview build"
value="1.8 s"
detail="Local preview of a sample project."
icon="lucide:clock"
tone="accent"/>
</Panel>
<Panel tone="neutral" variant="surface" class="p-5">
<MetricItem
label="Availability"
value="99.9%"
detail="Example service over the last 30 days."
icon="lucide:shield-check"
tone="success"/>
</Panel>
</Grid> Supporting content
Use the default slot to add a status badge, a short explanation, or a useful destination. MetricItem supplies the spacing; the content stays yours.
Release readiness
Every check in this example release is complete.
The value can be a word. Supporting content adds the detail and destination.
<Panel tone="neutral" variant="surface" class="p-5">
<MetricItem
label="Release readiness"
value="Ready"
detail="Every check in this example release is complete."
icon="lucide:circle-check"
tone="success"
>
<Flex wrap="true" align="center" class="gap-3">
<Badge tone="success">8 of 8 checks</Badge>
<BtnLink
href="/components/"
variant="link"
tone="neutral"
icon="lucide:arrow-right"
iconPosition="end"
>
Review components
</BtnLink>
</Flex>
</MetricItem>
</Panel> All ten semantic tones
Tone colors the optional icon frame. The label, value, and detail keep the surrounding text color, so they also work inside a colored MetricStrip.
neutral Components
One shared design language
accent Components
One shared design language
feature Components
One shared design language
secondary Components
One shared design language
custom Components
One shared design language
ghost Components
One shared design language
info Components
One shared design language
success Components
One shared design language
warning Components
One shared design language
danger Components
One shared design language
Switch the site theme to compare the same samples in both palettes.
A number with the right context
Minimal, including zeroLabel and detailGuides
Updated this week
Formatted valueAvailability
Rich default slotRelease health
Last reviewed today.
value is display text; formatting, units, data fetching, and change calculations belong to your application.
Feature map
| Public feature | Visible example |
|---|---|
| tone | Complete galleries above, with all supported values visible together. |
| label, value, detail | Compare the minimal number, a labelled value, and a formatted percentage. value is display text. |
| icon | The percentage and rich-content examples add an icon; the minimal and labelled examples omit it. |
| Default slot | Rich default slot adds a status badge and extra supporting text. |
| Native attributes and events | Pass attributes through the root; keyboard behavior belongs to the composed native controls. |
This component exposes tone but no variant or variantMode. Its icon uses a fixed surface treatment.
Behavior and accessibility
The value is text, so units and formatted numbers remain under your control. Labels and details explain what it means; the icon is decorative. Tone affects the optional icon frame and does not imply a trend or change the value's meaning.
MetricItem uses existing typography and layout utilities and adds no custom stylesheet. It has no background of its own: use it directly, place it inside Panel, or group related items in MetricStrip.
API reference
MetricItem contract
Props below are the public template API. RefOrValue accepts a literal or a reactive ref; bind refs with a colon-prefixed attribute. Native attributes and events can be passed through the component root.
label
RefOrValue<string> - Default
not set
A short, readable label above the value. Name what is being measured or described.
value
RefOrValue<string> - Default
not set
Displayed value as text, including any unit or formatting.
detail
RefOrValue<string> - Default
not set
Supporting explanation below the value.
icon
RefOrValue<string> - Default
not set
Registered SVG icon name. In browser apps, include the icon in the resolver passed to defineIconComponents.
tone
RefOrValue<SemanticTone> - Default
inherited
Semantic intent: neutral, accent, secondary, info, success, warning, danger, feature, custom or ghost. The active skin supplies the colors.
Composition
Default slot: content after the detail. Register defineMetricItemComponent with Flex, IconFrame, and Icon dependencies.