suiss/ui · Chart
Pie Chart Active
A donut where one slice is enlarged and outlined with an outer arc to highlight it.
Pie Chart Active 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 donut with one slice pulled outward and traced by a thin outer arc, so a single category stands out from the rest. Use it to call attention to the segment a page is about, such as the current plan or the user's own device.
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-active.tsx:
- Update the import paths to match your project.
Usage
Replace chartData with your categories, giving each a value and a fill that points at its color in chartConfig. Set ACTIVE to the index of the slice you want to emphasize, or drive it from state if it should follow a selection.
Notes
The highlight is fixed and does not follow hover; wire ACTIVE to state if you need that.

A PieChart donut inside a Card, showing users by device. chartData holds one record per device with a users count. The Pie shape callback enlarges the slice at index ACTIVE and adds a thin arc outside it. 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; change ACTIVE to highlight a different slice. The component takes no props.
