React Native Pie & Donut for Expo
Pie or donut with rounded corners, pad angles, partial sweeps (semicircle), glowing segments, outside or percent labels and centre text. Drag around the ring to select; the active slice pops out.
Also known as: pie chart, donut chart, doughnut chart.
Live — the real React Native component rendered with react-native-web. Tap, drag and scrub it.
Installation
npx expo install expo-charts react-native-svgUsage
Import the component and pass your data. Width defaults to the parent, so it adapts to phones, tablets and rotation.
Like this? There's a lot more in Pro Pro
12 full screens built from the same kit — install them the same way.
Props
| Prop | Type | Default |
|---|---|---|
| data Rows like [{ browser: "chrome", visitors: 275 }]. | Datum[] | — |
| nameKey / valueKey Which keys hold the label and the number. | string | "name" / "value" |
| config Labels / colours keyed by name. | ChartConfig | — |
| size Diameter. | number | 260 |
| showLegend Legend under the chart. | boolean | false |
| legendVariant Legend marker style. | LegendVariant | "rounded-square" |
| glow Glow every segment or only named ones. | boolean | string[] | false |
| isLoading Skeleton state. | boolean | false |
| onSelect Selection callback. | (index, datum) => void | — |
| emptyText Shown when every value is 0 or data is empty. | string | "No data" |
| accessibilityLabel VoiceOver / TalkBack label. Swipe up / down selects each slice. | string | generated summary |
| innerRadius 0 = pie, 0.6 = donut. | number (0–0.95) | 0.6 |
| cornerRadius Rounded slice corners. | number | 0 |
| padAngle Gap between slices. | number (deg) | 0 |
| startAngle / endAngle -90 / 90 makes a semicircle. | number (deg) | 0 / 360 |
| activeIndex / defaultActiveIndex Controlled / initial selection. | number | null | null |
| activeOffset How far the active slice pops out. | number | 8 |
| labels Slice labels. | "none" | "inside" | "outside" | "percent" | "none" |
| centerValue / centerLabel Donut centre text (null hides). | string | total / "Total" |
| onScrubStart / onScrubEnd Pause your ScrollView while dragging round the ring. | () => void | — |
FAQ
How do I make a pie chart in React Native?
npx expo install expo-charts react-native-svg) and render <PieSeriesChart data={…} />. It's animated and touchable, and works on iOS, Android, web and in Expo Go.Does Pie & Donut work in Expo Go?
react-native-svg, which Expo Go includes, so it runs on iOS and Android with no development build.Is Pie & Donut free?
expo-charts, which is free and MIT-licensed.