suiss/ui · Chart
Bar Chart Active
A week of step counts where clicking a bar selects it, dims the others and updates the header.
Bar 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 week of step counts where one bar is selected at a time: the chosen day stays solid, the rest dim, and the header shows its value. Use it when a bar chart doubles as a picker for the detail shown above it.
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/bar-chart-active.tsx:
- Update the import paths to match your project.
Usage
Replace chartData with your own days and values, and rename steps in the data, the Bar and chartConfig. Set the initially selected bar through the selected state, and change the unit text and number format in the header. Lower or raise the opacity of the dimmed bars to tune the contrast.
Notes
Keyboard users move between bars with the arrow keys and select with Return or Space, and the header value is announced through a live region. There is no tooltip; the header is the only readout.

Seven bars, one per day, with the selected bar at full opacity and the others dimmed. The BarChart reports the touched bar through onActiveIndexChange, which updates local state and the header. The header is a live region, so screen readers announce the new step count. The bars set isAnimationActive={false} and draw without the enter animation.
Installation
The CLI also adds what it builds on: Card, Chart, Text.
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 daily values and update the day and steps keys to match. The initial selection is set by the useState default. The component takes no props.
