React Capability Histogram

Where the control chart asks whether a process is stable, this asks whether it is capable — whether its natural spread actually fits inside the spec window. It bins the sample, draws the limits, fits a normal curve, and computes Cp and Cpk.

Gate oxide thickness

n 220 · μ 4.623 nm · σ 0.070 nm

Not capable
Cp
1.42

Spread only

Cpk
0.84

Spread and centring

Out of spec
1

0.5% of sample

Spec window
0.600

4.200 – 4.800 nm

LSLUSLTargetμ4.1644.6234.842047

Installation

npx shadcn@latest add "https://kelvinui.com/registry/capability-histogram.json"

Props

PropTypeDescription
valuesnumber[]The raw sample
usl lslnumberUpper / lower spec limits
targetnumberNominal, drawn separately from the limits
binsnumberHistogram bin count (default 18)
unitstringAppended to statistics
showCurvebooleanOverlay the fitted normal (default true)
heightnumberSVG height (default 260)

Cp says the spread fits; Cpk says it fits where it is

This is the distinction the component is built to make visible:

  • Cp = (USL − LSL) / 6σ — could the distribution fit the window if it were perfectly centred?
  • Cpk = min((USL − μ) / 3σ, (μ − LSL) / 3σ) — does it fit given where the mean actually sits?

The demo has Cp ≈ 1.42 with Cpk ≈ 0.84: the spread is comfortably tight, but the process runs high, so it eats into the upper limit anyway. That gap is the whole reason both indices exist — a healthy Cp with a poor Cpk means recentre, not reduce variation, and those are very different corrective actions. The convention baked into the status pill: Cpk ≥ 1.33 capable, ≥ 1.0 marginal, below that not capable.

Deterministic demo data

The sample is generated from a seeded Box–Muller draw, never Math.random(). In a statically exported app, random data computed at render time produces different numbers on the server and the client — a guaranteed hydration mismatch. If you feed this component synthetic data, seed it; if you feed it real measurements, you are fine.

New components every week

Get the week's new Kelvin UI components and templates in one short email. No spam, unsubscribe anytime.