suiss/ui · Chart
Area Chart Gradient
Two overlapping areas whose fills fade out toward the bottom using SVG linear gradients.
Area Chart Gradient is an open-source chart from suiss/ui for React, React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.
Two overlapping series whose fills fade to transparent toward the baseline, so the lower series stays visible through the upper one. Reach for it over the flat-filled default when you compare two series that cross each other.
Installation
CLI
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
Manual
- Install the dependencies:
-
Copy the source into
components/charts/area-chart-gradient.tsx:
- Update the import paths to match your project.
Usage
Replace chartData and rename the two series keys consistently across the data, the areas and chartConfig. Each series needs its own gradient in the defs block, so add or rename one when you add a series. Raise or lower the top stop's stopOpacity to make the fill stronger or subtler.
Notes
The series are drawn in source order, so the last Area sits on top. Focus the plot and use the arrow keys to move the tooltip between months.

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
The CLI also adds what it builds on: Card, Chart.
Manual
-
Target iOS 17 or later.
-
Copy the theme files every view uses:
- Copy the source and every file it uses:
- Add the files to your app target.
- Set
minSdkto 24 or higher and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.
Usage
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.
