Skip to main content
NetScriptdocs Search docs ⌘K v0.0.9
Browse documentation

StatsGrid

Responsive summary-metric grid for dashboard overview and route-level status cards.

All components · Theme builder · Implementation source

Live preview

Open live stats-grid preview

Install

Shell
netscript ui:add stats-grid

Usage and examples

The preview runs this JSX with the installed components. Import any composed primitives from your UI directory.

TypeScript
import { useState } from 'preact/hooks';
import { StatsGrid } from '@app/components/ui/stats-grid.tsx';

export function Example() {
  const [value, setValue] = useState('standard');
  const [open, setOpen] = useState(false);
  const [notice, report] = useState('');
  return (<><div><StatsGrid><StatsGrid.Card label="Orders" value="3,182" detail="Past 30 days" /><StatsGrid.Card label="Refund rate" value="1.8%" /></StatsGrid></div><p role="status">{notice}</p></>);
}

Props

Generated from native deno doc --json --private over the shipped implementation. Compound component props retain their owning interface; native attributes pass through where declared.

OwnerPropTypeOptionalDescription
StatsCardPropslabelRenderableNoSmall uppercase label above the metric value.
StatsCardPropsvalueRenderableNoPrimary metric value.
StatsCardPropsdetailRenderableYesOptional supporting detail below the metric.
StatsCardPropsbadgeRenderableYesOptional badge rendered beside the label.
StatsCardPropsclassstringYes
StatsGridPropschildrenRenderableNo
StatsGridPropsclassstringYes
TypeScript
StatsCardProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "class" | "children">
StatsGridProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "class" | "children">

Keyboard

Presentation component; no component-specific keyboard interactions.

Tokens

Semantic contract roles: destructive/text, primary/default, primary/fg, radius/card, space/card/padding, success/text, text/fg, text/muted.

CSS custom properties referenced directly: --ns-card-bg, --ns-card-border, --ns-card-border-bottom, --ns-card-border-side, --ns-card-border-top, --ns-fg, --ns-font-eyebrow, --ns-font-kpi, --ns-font-mono, --ns-font-sans, --ns-kpi-gap, --ns-leading-kpi, --ns-leading-label, --ns-leading-relaxed, --ns-leading-small, --ns-muted-fg, --ns-radius-card, --ns-space-3, --ns-space-4, --ns-text-2xs, --ns-text-3xl, --ns-text-kpi, --ns-text-label, --ns-text-sm, --ns-text-small, --ns-tracking-kpi, --ns-tracking-small, --ns-tracking-tight, --ns-tracking-wide, --ns-weight-eyebrow, --ns-weight-kpi, --ns-weight-small.

Contract and compatibility

Accessibility pattern: noninteractive presentation

  • Native DOM attributes pass through where the implementation accepts them.

Design contract values marked planned are not implementation props. The props above describe what ships today.

Search all documentation

Type a term to search the documentation.