suiss/uim · Chart

Area Chart Sparkline

A stock watchlist where each row has a small area chart next to its price and daily change.

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

Each row shows a symbol and company name, a tiny area chart without axes, the price and a colored badge with the percentage change. The sparkline turns green when the change is positive and red when it is negative, using the up and down colors in chartConfig. The charts are hidden from screen readers because the row text already carries the values. Each sparkline sets isAnimationActive={false} and draws without the enter animation.

Installation

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

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

Manual

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

  2. Copy the source into components/charts/area-chart-sparkline.tsx:

uniwind/components/charts/area-chart-sparkline.tsx
import { cn } from "cn"
import { View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  Area,
  AreaChart,
  type ChartConfig,
  ChartContainer,
  YAxis,
} from "@/components/ui/chart"
  1. Update the import paths to match your project.

Usage

import { AreaChartSparkline } from "@/components/charts/area-chart-sparkline"
<AreaChartSparkline />

Replace the stocks array with your own symbols, prices and changes, and swap the generated series data for real price history. The component takes no props.