suiss/uim · Chart

Bar Chart Interactive

A screen-time dashboard with stacked category bars, a week and day toggle, and a list of most used apps.

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

Bars stack social, productivity and entertainment time. A ToggleGroup switches between a weekly view and an hourly view of one day. In the week view, touching a bar selects that day through onActiveIndexChange, dims the other days and updates the headline, comparison text, category totals and the most used apps list below. A dashed line marks the weekly average. The bars set isAnimationActive={false}, so they draw without the enter animation and switch views instantly.

Installation

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

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

Manual

  1. Install the dependencies:
npx expo install cn
  1. Add the pieces it builds on: Card, Chart, Text, Toggle Group.

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

uniwind/components/charts/bar-chart-interactive.tsx
import { cn } from "cn"
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,
  ChartTooltip,
  ChartTooltipContent,
  ReferenceLine,
  XAxis,
  YAxis,
  1. Update the import paths to match your project.

Usage

import { BarChartInteractive } from "@/components/charts/bar-chart-interactive"
<BarChartInteractive />

Replace USAGE with daily minutes per category and APPS with your apps and their share of each category. The hourly view is generated from PROFILE, so swap hourly() for real data. The component takes no props.