Chart

Chart primitives.

Use ChartContainer to render line, bar, and area charts from a config.

Monthly device trafficJanFebMarApr
Desktop
Mobile
import { ChartContainer } from '@tile-ui/react';

export default function ChartDemo() {
	return (
		<ChartContainer
			title="Monthly device traffic"

Registry install

pnpm dlx shadcn@latest add @tile-ui/chart

Package usage

import { ChartContainer } from '@tile-ui/react';
 
<ChartContainer
	config={{ desktop: { label: "Desktop" } }}
	data={[{ x: "Jan", desktop: 100 }]}
	xKey="x"
	type="line"
/>

Highlights

  • Line, bar, and area
  • Legend and tooltip
  • Light and dark themes

Registry dependencies

ItemPurpose
chartComponent source and module styles
coreFramework-agnostic logic helpers
stylesShared SCSS tokens and globals

API reference

ChartContainer

PropTypeDefault
configRecord<string, ChartConfigItem>
dataChartDatum[]
xKeystring
seriesChartSeriesItem[]
type'line' | 'bar' | 'area'
initialDimension{ width: number; height: number }
showLegendboolean
showTooltipboolean
showGridboolean
showAxisboolean