# StatsGrid

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

[All components](https://rickylabs.github.io/netscript/design-system/components/) · [Theme builder](https://rickylabs.github.io/netscript/create/) · [Implementation source](https://github.com/rickylabs/netscript/blob/main/packages/fresh-ui/registry/components/ui/stats-grid.tsx)

## Live preview

[Open live stats-grid preview](https://rickylabs.github.io/netscript/assets/fresh-ui/preview/?component=stats-grid&theme=studio-utility)

## Install

```bash
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.

```tsx
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.

| Owner | Prop | Type | Optional | Description |
| --- | --- | --- | --- | --- |
| `StatsCardProps` | `label` | `Renderable` | No | Small uppercase label above the metric value. |
| `StatsCardProps` | `value` | `Renderable` | No | Primary metric value. |
| `StatsCardProps` | `detail` | `Renderable` | Yes | Optional supporting detail below the metric. |
| `StatsCardProps` | `badge` | `Renderable` | Yes | Optional badge rendered beside the label. |
| `StatsCardProps` | `class` | `string` | Yes |  |
| `StatsGridProps` | `children` | `Renderable` | No |  |
| `StatsGridProps` | `class` | `string` | Yes |  |

```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.
