# Weeks of cover

How many weeks the stock on hand lasts at the current rate of sale, on a track against the band the buyer wants it in: short is a stockout risk, over is cash on a shelf.

Docs: https://ui.twelfth.ai/weeks-of-cover · Category: Stock · Updated: 2026-10-30

## Install

```bash
npx shadcn@latest add https://ui.twelfth.ai/r/weeks-of-cover.json
```

```tsx
import { WeeksOfCover } from "@/components/ui/weeks-of-cover"
```

## Example

```tsx
<WeeksOfCover
  weeks={18}
  min={4}
  max={12}
  scale={24}
/>
```

## Every state

```tsx
<WeeksOfCover weeks={1.5} min={4} max={12} scale={24} /> // 2.5 wks short
<WeeksOfCover weeks={6} min={4} max={12} scale={24} />   // In band
<WeeksOfCover weeks={18} min={4} max={12} scale={24} />  // 6 wks over
<WeeksOfCover weeks={null} min={4} max={12} />           // No net sales
```

## Aged stock line

No lower bound: anything past 26 weeks is aged cash.

```tsx
<WeeksOfCover weeks={41} max={26} scale={52} />
```

## Dense, for a table cell

```tsx
<WeeksOfCover weeks={34} min={4} max={12} scale={24} showState={false} />
```

## WeeksOfCover props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `weeks` (required) | `number \| null` |  | Saleable units ÷ weekly rate of sale. null when nothing sold. |
| `max` (required) | `number` |  | Top of the healthy band. |
| `min` | `number` | `0` | Bottom of the band, e.g. lead time plus safety stock. |
| `scale` | `number` | `max × 1.5` | Weeks the track spans; beyond it the figure reads ›. |
| `showState` | `boolean` | `true` | Say "6 wks over" beside the figure. |

## Notes

- role="meter" with the value, band and state in its label.

---

twelfth UI: Open-source (MIT) shadcn components for category managers and retail buying teams, by twelfth (https://twelfth.ai). React and TypeScript on shadcn's Base UI styles and Tailwind CSS v4. Components take plain props and fetch no data. Every block: https://ui.twelfth.ai/llms.txt
