suiss/uim · Chart

Bar Chart Stacked

Stacked bars combining desktop and mobile visitors per month, with a legend.

Bar Chart Stacked is an open-source mobile chart from suiss/uim, drawn with react-native-svg for React Native and Expo, with SwiftUI and Jetpack Compose versions built from the same design tokens. The @esuiss/uim CLI copies its source into your project, so you own the code.

iOS
Bar (stacked) on iOS in light mode

Desktop and mobile bars share a stackId, so each column shows both parts and their total. Only the outer corners are rounded, and a legend below the plot names both series.

Installation

$ pnpm dlx @esuiss/uim@latest add bar-chart-stacked

The CLI also adds what it builds on: Card, Chart.

Manual

  1. Add the pieces it builds on: Card, Chart.

  2. Copy the source into components/charts/bar-chart-stacked.tsx:

uniwind/components/charts/bar-chart-stacked.tsx
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  Bar,
  BarChart,
  CartesianGrid,
  type ChartConfig,
  ChartContainer,
  ChartLegend,
  ChartLegendContent,
  ChartTooltip,
  1. Update the import paths to match your project.

Usage

import { BarChartStacked } from "@/components/charts/bar-chart-stacked"
<BarChartStacked />

Replace chartData with your records and change each dataKey to match your fields. Add, rename or recolor series in chartConfig and add a Bar for each. The component takes no props.