suiss/ui · Chart
Pie Chart Default
A full pie split into five device slices, separated by thin card-colored borders.
Pie Chart Default is an open-source chart from suiss/ui for React, React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.
A full pie split into five slices separated by thin gaps, with a tooltip for each slice. Use it for a quick part-to-whole view of a small number of categories.
Installation
CLI
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
Manual
- Install the dependencies:
-
Copy the source into
components/charts/pie-chart-default.tsx:
- Update the import paths to match your project.
Usage
Give each record a category key, a value and a fill that references its color, then add a label and color for every key in chartConfig. Point dataKey and nameKey on the Pie at your value and category fields.
Notes
Pies work best with about five slices or fewer; group the long tail into an Other slice.

The simplest PieChart: one Pie inside a Card, with slices separated by a thin stroke in the card color. chartData holds one record per device with a users count. Pressing a slice shows a tooltip with its name and value.
Installation
The CLI also adds what it builds on: Card, Chart.
Manual
-
Target iOS 17 or later.
-
Copy the theme files every view uses:
- Copy the source and every file it uses:
- Add the files to your app target.
- Set
minSdkto 24 or higher and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.
Usage
Replace chartData with your records and keep dataKey and nameKey in step with your field names. Add one entry per slice to chartConfig with its label and color; the component takes no props.
