suiss/uim · Chart

Bar Chart Active

A weekly step count where tapping a bar selects that day and shows its total in the header.

Bar Chart Active 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 (active) on iOS in light mode

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

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

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

Manual

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

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

uniwind/components/charts/bar-chart-active.tsx
import * as React from "react"
import { View } from "react-native"
import { Card, CardContent, CardHeader } from "@/components/ui/card"
import {
  Bar,
  BarChart,
  CartesianGrid,
  Cell,
  type ChartConfig,
  ChartContainer,
  XAxis,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"

const chartData = [
  { day: "Monday", steps: 8412 },
  1. Update the import paths to match your project.

Usage

import { BarChartActive } from "@/components/charts/bar-chart-active"
<BarChartActive />

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.