Data display
Chart
interactive/sparkline · area · onPointerChange
Line chart
function LineChartDemo() { const [pt, setPt] = React.useState<{ x: number; y: number } | null>(null); return ( <View className="w-full gap-3"> <View className="flex-row items-baseline justify-between"> <Text className="text-2xl font-semibold">{pt ? pt.y : PRICES[PRICES.length - 1]}</Text> <Text className="text-muted-foreground text-sm">{pt ? `Day ${pt.x + 1}` : 'Active users · drag to scrub'}</Text> </View> <LineChart data={PRICES} height={140} area onPointerChange={setPt} /> <View className="flex-row gap-4"> <LineChart variant="sparkline" data={PRICES} height={36} width={100} tone="success" area /> <LineChart variant="sparkline" data={[...PRICES].reverse()} height={36} width={100} tone="destructive" /> </View> </View> );}Usage
Interactive variant reports the scrubbed point; render your own header from it.
API
<LineChart data variant="interactive|sparkline" height tone area? onPointerChange? />Get it
Already in every copy of the native kit:
import { LineChart } from '@/components/kit/line-chart';Details
- Exports
LineChart- Packages
- react-native-svg@15.15.4
- Installs with
- @halftone-native/lib-palette-context
- Also searched as
- sparkline, trend, time series, graph
- Registry JSON
- /r/native/line-chart.json
Bar chart
function BarChartDemo() { return ( <BarChart className="w-full" showValues data={[ { label: 'Mon', value: 12 }, { label: 'Tue', value: 18 }, { label: 'Wed', value: 9 }, { label: 'Thu', value: 22, className: 'bg-success' }, { label: 'Fri', value: 15 }, { label: 'Sat', value: 6, className: 'bg-muted-foreground' }, { label: 'Sun', value: 4, className: 'bg-muted-foreground' }, ]} /> );}API
<BarChart data={[{label,value,className?}]} height showValues? />Get it
Already in every copy of the native kit:
import { BarChart } from '@/components/kit/bar-chart';Details
- Exports
BarChart- Installs with
- @halftone-native/lib-utils, @halftone-native/text
- Also searched as
- bars, histogram, weekly
- Registry JSON
- /r/native/bar-chart.json
Donut chart
function DonutChartDemo() { const data = [ { label: 'Design', value: 40 }, { label: 'Research', value: 25 }, { label: 'Build', value: 20 }, { label: 'Review', value: 15 }, ]; return ( <View className="w-full flex-row items-center gap-6"> <DonutChart data={data} size={140}> <Text className="text-xl font-semibold">42h</Text> <Text className="text-muted-foreground text-xs">this week</Text> </DonutChart> <ChartLegend data={data} className="flex-1" /> </View> );}API
<DonutChart data size>{centre}</DonutChart> + <ChartLegend data />Get it
Already in every copy of the native kit:
import { DonutChart, ChartLegend } from '@/components/kit/donut-chart';Details
- Exports
DonutChart,ChartLegend- Packages
- react-native-svg@15.15.4
- Installs with
- @halftone-native/lib-palette-context, @halftone-native/lib-theme, @halftone-native/lib-utils, @halftone-native/text
- Also searched as
- pie, ring, allocation, breakdown
- Registry JSON
- /r/native/donut-chart.json
<ChartContainer config={chartConfig} className="aspect-auto h-56 w-full max-w-xl"> <BarChart accessibilityLayer data={chartData}> <CartesianGrid vertical={false} /> <XAxis dataKey="month" tickLine={false} axisLine={false} tickMargin={8} /> <ChartTooltip content={<ChartTooltipContent />} /> <Bar dataKey="visitors" fill="var(--color-visitors)" radius={6} /> </BarChart></ChartContainer>Usage
Colour every series with a chart token through the config, never a hex.
API
<ChartContainer config={{ key: { label, color: "var(--chart-1)" } }}><BarChart data>…</BarChart></ChartContainer>Get it
Already in every copy of the web kit:
import { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent } from '@/components/ui/chart';Details
- Exports
ChartContainer,ChartTooltip,ChartTooltipContent,ChartLegend,ChartLegendContent- Packages
- cn@^0.5.2, recharts@^3.8.0
- Also searched as
- graph, bar chart, line chart, recharts
- Registry JSON
- /r/web/chart.json
Agents: the whole registry is at /llms.txt.