BoxPlot

Chart
Quartile boxes, whiskers, and outlier dots per category, computed by the chart from raw samples: quartiles by linear interpolation, whiskers at the most extreme data inside the 1.5 IQR fences, outliers beyond them. Scrub a category to flag its five-number summary; each category's summary also folds into the accessible name.

Playground

Every control sets a real prop of BoxPlotProps. The JSX below updates as you go.
Latency by region
Props
Tone
pick one
compact
boolean
hideGrid
boolean
JSX · BoxPlotProps
<BoxPlot />

Variants

2 examples from src/charts/box-plot/box-plot.md, each rendered live from its own JSX.
Compact
<BoxPlot
compact
data={[
{ label: "A", values: [3.1, 3.4, 3.2, 3.8, 3.5, 3.3, 3.9, 3.6] },
{ label: "B", values: [4.2, 4.6, 4.4, 5.1, 4.8, 4.5, 5.4, 4.9] },
]}
/>
Inspected
<BoxPlot
defaultSelected={1}
data={[
{ label: "Mon", values: [2, 4, 3, 5, 4, 3, 6] },
{ label: "Wed", values: [3, 6, 5, 8, 6, 5, 9] },
{ label: "Fri", values: [5, 9, 7, 12, 9, 8, 22] },
]}
/>

Anatomy

Latency by region
1
Chart frame
2
Box
3
Axis labels
4
Median
5
Gridlines
Dimmed parts appear only in some states or variants.

Props

14 props on BoxPlotProps, grouped as they are declared in source. Required props are marked *.
Prop
Type
Default
Description
Props
2 props
data *
BoxSample[]
–
One box per category, in order.
title
string
–
Optional heading shown above the plot.
Tone
pick one
2 props
success
boolean
false
destructive
boolean
false
Density
2 props
compact
boolean
false
plain
boolean
false
Strip the card surface for nesting inside an existing card (mirrors Stats).
Furniture visibility
8 props
hideGrid
boolean
false
Furniture visibility.
hideAxes
boolean
false
Furniture visibility.
formatValue
(v: number) => string
–
Formats tick labels, the flag, and the accessible name.
selected
number | null
–
Scrub-to-inspect: the selected category index (controlled). Pass null for none.
defaultSelected
number
–
Scrub-to-inspect: the initially selected category (uncontrolled).
onSelect
(index: number | null) => void
–
Fired when a press/scrub selects a category (or clears it with null).
testID
string
–
E2E hook forwarded to the root element.
style
LayoutStyle
–
Composition within a parent only, never a restyle hook and never a width: the parent layout container provides the bounds.

Accessibility and keyboard

Keyboard
Tab
Focuses the plot
ArrowLeft
ArrowRight
Steps through points when inspectable
Escape
Clears the inspected point
Semantics
Roles
group
image
img
ARIA on web
aria-label
From the docs
Quartile boxes, whiskers, and outlier dots per category, computed by the chart from raw samples: quartiles by linear interpolation, whiskers at the most extreme data inside the 1.5 IQR fences, outliers beyond them. Scrub a category to flag its five-number summary; each category's summary also folds into the accessible name.

Platform skins

The playground's props on each platform: same tree, native shapes, type and touch sizes.
Web
control 10 · field 10 · card 16 · Instrument Sans
iOS
capsule controls · field 8 · card 12 · SF Pro · 44 pt
Android
Material 3 stadium · field 4 · card 12 · Roboto · 48 dp

Usage

<BoxPlot
title="Latency by region"
data={[
{ label: "us-east", values: [42, 38, 51, 44, 47, 39, 96] },
{ label: "eu-west", values: [55, 61, 58, 64, 57, 63] },
{ label: "ap-south", values: [71, 78, 74, 83, 76, 124] },
]}
/>

Tokens

Read from the playground render. Values follow the scheme and the ion hue.
--c1
--fd
--fm
--ft
--ln
--sf
--sh-sm
--tx3

Related components