suiss/uim · Chart

Area Chart Gradient

Two overlapping areas whose fills fade toward the bottom, comparing desktop and mobile visitors.

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

Two series, desktop and mobile, drawn as natural curves on the same axis. Both use a shared gradient fill that fades out toward the baseline, so the overlap stays readable. A month axis, a dashed grid and a tooltip listing both values complete the chart.

Installation

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

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

uniwind/components/charts/area-chart-gradient.tsx
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  Area,
  AreaChart,
  CartesianGrid,
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  XAxis,
  1. Update the import paths to match your project.

Usage

import { AreaChartGradient } from "@/components/charts/area-chart-gradient"
<AreaChartGradient />

Replace chartData with your records and change each dataKey to match your fields. Add or rename series in chartConfig, and change the fade stops to make the gradient stronger or lighter. The component takes no props.