suiss/ui · Chart
Bar Chart Horizontal
Horizontal bars with category names on the left and a distinct color for each category.
Bar Chart Horizontal 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.
Horizontal bars with category names down the left and a different color per category. Choose it over vertical bars when labels are long or when you are ranking items.
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-horizontal.tsx:
- Update the import paths to match your project.
Usage
Give each record a category key, a value and a fill that points at its color variable, then add a matching entry with label and color to chartConfig. The left axis reads its text from those config labels. Change barSize to make the bars thicker or thinner.
Notes
The label column sizes itself to the longest name. Keyboard users can focus the chart and step through the bars with the arrow keys.

A BarChart with layout="vertical", so categories run down a YAxis and bars extend to the right, which leaves room for longer names. Each bar gets its color from chartConfig through a Cell, and the axis labels come from the same config.
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 categories and values, and add a matching entry with a label and color to chartConfig for each category. The component takes no props.
