A React Native radar chart for comparing multivariate mobile data with fill, dots, and multiple series.
RadarChartruns on the UI thread. React renders the parts once; data changes, the grow-in, the active vertex dot and the tooltip all update through Reanimated shared values without re-rendering. Rendering a chart requires the optionalreact-native-skiapeer (>=3.0.0).
import { RadarChart } from 'heroui-native-pro';<RadarChart data={...} labelKey="..." dataKey="...">
<RadarChart.Grid />
<RadarChart.AngleAxis />
<RadarChart.RadiusAxis />
<RadarChart.Radar />
<RadarChart.Tooltip />
</RadarChart>data, one per spoke), the field holding each spoke's label (labelKey), the default series field (dataKey) and an optional fixed maxValue. Owns the canvas, the press gesture and the animation settings for every part. Set its height with className.labelKey field.Every part is optional.
RadarChart.Radar plots the root's dataKey in the theme chart-3 color.
<RadarChart
data={DATA}
labelKey="category"
dataKey="score"
className="h-[280px]"
>
<RadarChart.Grid />
<RadarChart.AngleAxis />
<RadarChart.Radar />
</RadarChart>Render one RadarChart.Radar per field. Set the color with colorClassName (a Uniwind color class) or color (any color string, takes precedence). Set maxValue on the root so every series shares one scale.
<RadarChart
data={DATA}
labelKey="category"
dataKey="teamA"
maxValue={100}
className="h-[300px]"
>
<RadarChart.Grid />
<RadarChart.AngleAxis />
<RadarChart.Radar dataKey="teamA" colorClassName="accent-chart-3" />
<RadarChart.Radar dataKey="teamB" colorClassName="accent-chart-1" />
</RadarChart>Without maxValue, each series fits its own largest value.
Set fillOpacity={0} and showDots to read each vertex as a discrete marker.
<RadarChart.Radar fillOpacity={0} strokeWidth={2} showDots dotRadius={4} />shape="circle" draws round rings instead of polygons, for charts read as a continuous gauge rather than a categorical comparison.
<RadarChart.Grid shape="circle" />numTicks sets the ring count (default 5) and showSpokes={false} hides the spokes.
RadarChart.RadiusAxis labels each ring with its value. tickFormatter formats the values (runs on the JS thread; values are rounded by default) and includeZero adds a 0 label at the center.
<RadarChart
data={DATA}
labelKey="category"
dataKey="score"
maxValue={100}
className="h-[300px]"
>
<RadarChart.Grid />
<RadarChart.AngleAxis />
<RadarChart.RadiusAxis
includeZero
tickFormatter={(value) => `${Math.round(value)}%`}
/>
<RadarChart.Radar />
</RadarChart>angle moves the axis to another spoke, in degrees clockwise from 12 o'clock (0, the default, is the top spoke). Labels rotate with the spoke so they read along it. orientation places them left, middle or right (default) of the spoke.
<RadarChart.RadiusAxis angle={90} orientation="middle" />When several series plot different fields, set maxValue on the root so the axis matches every polygon. Without it the axis follows the root's dataKey, or its own dataKey override.
Pass a Skia font from useFont to either axis to change the default system font.
import { useFont } from 'react-native-skia';
const font = useFont(require('./assets/Inter-Medium.ttf'), 12);
<RadarChart.AngleAxis font={font} />;Pass a new data array and the polygons glide to it. Always pass a new array: changes made to the same array in place are not detected.
<RadarChart
data={presets[preset]}
labelKey="category"
dataKey="score"
maxValue={100}
animate={{ type: 'spring' }}
className="h-[280px]"
>
<RadarChart.Grid />
<RadarChart.AngleAxis />
<RadarChart.Radar />
</RadarChart>animate is true by default (300 ms timing). Pass a timing or spring config, or false. animation="disable-all" turns off every animation in the chart, including each series' animateIn.
animateIn on RadarChart.Radar grows the polygon out of the center on mount (true is 700 ms; a number sets the duration). Change resetKey to replay it.
const [replay, setReplay] = useState(0);
<RadarChart.Radar animateIn={900} resetKey={replay} />;Long-press near a spoke (100 ms by default) to select it. Each RadarChart.Radar shows a dot on the pressed vertex (activeDotRadius, default 5; 0 hides it), and RadarChart.Tooltip shows the spoke's label and the root dataKey value.
<RadarChart
data={DATA}
labelKey="category"
dataKey="score"
className="h-[280px]"
>
<RadarChart.Grid />
<RadarChart.AngleAxis />
<RadarChart.Radar />
<RadarChart.Tooltip />
</RadarChart>To react on the JS thread, use onSelect. It fires when the pressed spoke changes, and with null when the press ends.
<RadarChart
data={DATA}
labelKey="category"
dataKey="score"
onSelect={(event) => setActive(event?.row ?? null)}
>selection={{ activateAfter: 200 }} changes the press delay; selection={false} turns inspection off.
Build the content from ChartTooltipLabel and ChartTooltipValue, for example to show every series. They re-render only when the selection moves to another spoke. Pass the root's labelKey field as xKey. With a worklet format (or none), their text is written from the UI thread instead; see Tooltip text on the UI thread.
import { ChartTooltipLabel, ChartTooltipValue } from 'heroui-native-pro';
<RadarChart.Tooltip className="gap-0.5 rounded-xl bg-default px-2.5 py-1.5">
<ChartTooltipLabel xKey="category" className="text-xs font-semibold" />
<ChartTooltipValue dataKey="teamA" className="text-xs text-muted" />
<ChartTooltipValue dataKey="teamB" className="text-xs text-muted" />
</RadarChart.Tooltip>;import { Card } from 'heroui-native';
import { RadarChart } from 'heroui-native-pro';
import { View } from 'react-native';
const DATA = [
{ category: 'Design', score: 86 },
{ category: 'Frontend', score: 92 },
{ category: 'Backend', score: 74 },
{ category: 'DevOps', score: 65 },
{ category: 'Testing', score: 78 },
{ category: 'Leadership', score: 70 },
];
export default function SkillAssessmentChart() {
return (
<View className="flex-1 justify-center px-5">
<Card>
<Card.Header>
<Card.Title>Skill Assessment</Card.Title>
</Card.Header>
<Card.Body>
<RadarChart
data={DATA}
labelKey="category"
dataKey="score"
maxValue={100}
className="h-[280px]"
>
<RadarChart.Grid />
<RadarChart.AngleAxis />
<RadarChart.Radar
fillOpacity={0.15}
showDots
dotRadius={3}
animateIn
/>
<RadarChart.Tooltip />
</RadarChart>
</Card.Body>
</Card>
</View>
);
}The chart deliberately stays left-to-right in RTL layouts: everything inside the canvas is drawn by Skia in physical coordinates. Pair the chart with a text summary when the values matter to screen reader users.
| prop | type | default | description |
|---|---|---|---|
data | Row[] | - | One row per spoke. A new array animates; mutating the same array is not detected. |
labelKey | keyof Row | - | Field holding each spoke's label (string or number). |
dataKey | keyof Row | - | Numeric field Radar plots when it has no dataKey. The tooltip follows it. |
maxValue | number | fitted per series | Upper bound of the radial scale. Set it to compare series on one scale. |
animate | boolean | ChartTransition | true | Data-change animation ({ type: 'timing' | 'spring', ...config }). |
animation | 'disable-all' | - | "disable-all" turns off every animation in the chart. |
selection | { activateAfter?: number } | false | { activateAfter: 100 } | Press-to-inspect; false turns it off. |
onSelect | (event: { index: number; row: Row } | null) => void | - | Called on the JS thread when the pressed spoke changes; null when it ends. |
className | string | - | Root view class. Set the height here. |
children | ReactNode | - | Chart parts. |
| prop | type | default | description |
|---|---|---|---|
numTicks | number | 5 | Number of rings, excluding the center. |
shape | 'polygon' | 'circle' | 'polygon' | Shape of each ring. |
showSpokes | boolean | true | Draws one spoke per row. |
strokeColor | string | muted at 30% | Color of the rings and spokes. |
strokeWidth | number | 1 | Line width of the rings and spokes. |
| prop | type | default | description |
|---|---|---|---|
font | SkFont | null | chart axis font | Skia font. |
color | string | theme muted | Text color. |
radiusOffset | number | 1.05 | Label position along the spoke; 1 is the outer ring, > 1 beyond. |
| prop | type | default | description |
|---|---|---|---|
numTicks | number | 5 | Number of labels. Match the grid's numTicks. |
angle | number | 0 | Spoke the axis sits on, degrees clockwise from 12 o'clock. |
orientation | 'left' | 'middle' | 'right' | 'right' | Label alignment relative to the spoke. |
includeZero | boolean | false | Adds a 0 label at the center. |
dataKey | string | root dataKey | Field the scale is derived from when the root has no maxValue. |
tickFormatter | (value: number) => string | rounded value | Formats each label. Runs on the JS thread. |
font | SkFont | null | chart axis font | Skia font. |
color | string | theme muted | Text color. |
| prop | type | default | description |
|---|---|---|---|
dataKey | string | root dataKey | Field of each row to plot. |
colorClassName | string | 'accent-chart-3' | Uniwind color class for the stroke and fill. Ignored when color is set. |
color | string | - | Stroke and fill color. Takes precedence over colorClassName. |
fillOpacity | number | 0.3 | Opacity of the fill; the stroke stays opaque. |
showStroke | boolean | true | Draws the polygon outline. |
strokeWidth | number | 2 | Outline width. |
showDots | boolean | false | Draws a dot on every vertex. |
dotRadius | number | 3 | Vertex dot radius. |
activeDotRadius | number | 5 | Radius of the dot on the pressed vertex. 0 draws none. |
animateIn | boolean | number | false | Grows the polygon from the center on mount; true is 700 ms. |
resetKey | unknown | - | Changing it replays animateIn. |
| prop | type | default | description |
|---|---|---|---|
dataKey | string | root dataKey | Field whose value the default content shows. |
format | (value: number) => string | - | Formats the default value. Runs on the JS thread. |
placement | 'top' | 'bottom' | away from the center | Preferred side of the vertex; flips when there is no room. Without it, above the upper half of the chart and below the lower half. |
gap | number | 12 | Space between the anchor point and the tooltip. |
className | string | - | Tooltip view class. Replaces the default pill when children is set. |
children | ReactNode | - | Custom content (ChartTooltipLabel, ChartTooltipValue). |