suiss/uim · Chart

Area Chart Range

A heart-rate card with a shaded low-to-high band and an average line across 24 hours.

Area Chart Range 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
Area (range) on iOS in light mode

A ComposedChart that pairs a range Area, filled between each hour's low and high reading, with a Line for the hourly average. The header shows the day's lowest and highest values in BPM, and the tooltip formats both the range and the average with a custom row built from Text.

Installation

$ pnpm dlx @esuiss/uim@latest add area-chart-range

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/area-chart-range.tsx:

uniwind/components/charts/area-chart-range.tsx
import { View } from "react-native"
import { Card, CardContent, CardHeader } from "@/components/ui/card"
import {
  Area,
  CartesianGrid,
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  ComposedChart,
  Line,
  XAxis,
  YAxis,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"
  1. Update the import paths to match your project.

Usage

import { AreaChartRange } from "@/components/charts/area-chart-range"
<AreaChartRange />

Replace the readings array with [low, high, average] tuples for each hour; the header range and the chart data are derived from it. Adjust the YAxis domain and ticks to fit your values. The component takes no props.