Skip to content

Stats Panel (Key Value Pairs)

The StatsPanel component renders a horizontal set of key–value pairs — a label above its value — used across the application to surface entity metadata such as created/updated timestamps, status, ownership, and counts.

Each value accepts a React element, so it can be plain text, a StatusBadge, a TimeAgoCard, an icon, and more. A missing value renders as -, and passing isLoading shows skeleton placeholders.

Variations

Loading

Pass isLoading to render skeleton placeholders while data is being fetched.

Installation

import { StatsPanel, StatusBadge, TimeAgoCard } from "@harnessio/ui/components";
<StatsPanel
data={[
{ label: "Created", value: <TimeAgoCard timestamp="Dec 6, 2024" /> },
{ label: "Last updated", value: undefined }, // renders as "-"
{
label: "Connection status",
value: (
<StatusBadge variant="status" theme="success">
Success
</StatusBadge>
),
},
]}
/>;