:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { Tooltip } from '@posthog/lemon-ui'
export function MetricCard({
label,
value,
detail,
tooltip,
}: {
label: string
value: string
detail?: string
tooltip?: string
}): JSX.Element {
const labelElement = (
<div className={`text-xs font-semibold text-muted uppercase tracking-wide${tooltip ? ' cursor-help' : ''}`}>
{label}
</div>
)
return (
<div className="rounded bg-surface-secondary p-3 space-y-1">
{tooltip ? <Tooltip title={tooltip}>{labelElement}</Tooltip> : labelElement}
<div className="text-lg font-bold truncate">{value}</div>
{detail && <div className="text-xs text-secondary">{detail}</div>}
</div>
)
}