# Radial Chart

Ten radial charts for progress and proportions, from concentric bars to gauges, rings, stacked arcs and centered values.

Radial Chart 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.

Source: https://suiss.app/ui/docs/charts/radial-chart

Radial charts bend bars around a center to show progress toward a goal or how categories compare. Use concentric bars for a few categories, a single ring with a centered value for one percentage, and a gauge or three-quarter arc when the value has a limit. The rings, batteries and stacked variants cover activity rings, device charge and two series sharing one arc.

Each chart is built on the [Chart](https://suiss.app/ui/docs/components/chart) and [Card](https://suiss.app/ui/docs/components/card) components.

Every variant below is its own registry item, so you can add only the ones you need. Each one renders the same design on React, React Native, SwiftUI and Jetpack Compose.


## Radial Chart Default

Concentric radial bars, one per device, each running around a gray background track.

Source: https://suiss.app/ui/docs/charts/radial-chart#default

**React**

**Example**

```tsx title="components/charts/radial-chart-default.tsx"
"use client"

import { RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
} from "@/components/ui/chart"

const chartData = [
  { device: "phone", users: 275, fill: "var(--color-phone)" },
  { device: "laptop", users: 200, fill: "var(--color-laptop)" },
  { device: "tablet", users: 187, fill: "var(--color-tablet)" },
  { device: "watch", users: 173, fill: "var(--color-watch)" },
]

const chartConfig = {
  users: { label: "Users" },
  phone: { label: "Phone", color: "var(--chart-1)" },
  laptop: { label: "Laptop", color: "var(--chart-2)" },
  tablet: { label: "Tablet", color: "var(--chart-3)" },
  watch: { label: "Watch", color: "var(--chart-4)" },
} satisfies ChartConfig

export function RadialChartDefault() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Radial chart</CardTitle>
        <CardDescription>Users by device</CardDescription>
      </CardHeader>
      <CardContent>
        <ChartContainer
          config={chartConfig}
          className="aspect-auto h-52 w-full"
        >
          <RadialBarChart
            accessibilityLayer
            data={chartData}
            innerRadius="25%"
            outerRadius="100%"
            barSize={12}
          >
            <ChartTooltip
              cursor={false}
              content={<ChartTooltipContent hideLabel nameKey="device" />}
            />
            <RadialBar
              dataKey="users"
              background={{ fill: "var(--secondary)" }}
              cornerRadius={10}
            />
          </RadialBarChart>
        </ChartContainer>
      </CardContent>
    </Card>
  )
}
```

Concentric radial bars, one per category, each running along a gray background track. Use it as a compact, circular alternative to a bar chart for a few categories.

Give each record a category key, a value and a `fill` that points at its color, and add each key to `chartConfig`. `barSize` sets the ring thickness and `innerRadius` opens up the center. Arc lengths are relative to the largest value, which closes a full circle; add a `PolarAngleAxis` with a fixed `domain` to measure against a known maximum. The first record sits on the innermost ring, where the same value looks shorter.

### Installation

**Command**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-default
```

Works in any project with a `components.json`. See [Installation](https://suiss.app/ui/docs/installation#add-components) for the one-line registry setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-default
```

**Manual**

1. Install the following dependencies:

```bash title="Terminal"
npm install recharts
```

2. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

3. Copy and paste the following code into your project.

```tsx title="components/charts/radial-chart-default.tsx"
"use client"

import { RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
} from "@/components/ui/chart"

const chartData = [
  { device: "phone", users: 275, fill: "var(--color-phone)" },
  { device: "laptop", users: 200, fill: "var(--color-laptop)" },
  { device: "tablet", users: 187, fill: "var(--color-tablet)" },
  { device: "watch", users: 173, fill: "var(--color-watch)" },
]

const chartConfig = {
  users: { label: "Users" },
  phone: { label: "Phone", color: "var(--chart-1)" },
  laptop: { label: "Laptop", color: "var(--chart-2)" },
  tablet: { label: "Tablet", color: "var(--chart-3)" },
  watch: { label: "Watch", color: "var(--chart-4)" },
} satisfies ChartConfig

export function RadialChartDefault() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Radial chart</CardTitle>
        <CardDescription>Users by device</CardDescription>
      </CardHeader>
      <CardContent>
        <ChartContainer
          config={chartConfig}
          className="aspect-auto h-52 w-full"
        >
          <RadialBarChart
            accessibilityLayer
            data={chartData}
            innerRadius="25%"
            outerRadius="100%"
            barSize={12}
          >
            <ChartTooltip
              cursor={false}
              content={<ChartTooltipContent hideLabel nameKey="device" />}
            />
            <RadialBar
              dataKey="users"
              background={{ fill: "var(--secondary)" }}
              cornerRadius={10}
            />
          </RadialBarChart>
        </ChartContainer>
      </CardContent>
    </Card>
  )
}
```

4. Update the import paths to match your project setup.

### Usage

```tsx
import { RadialChartDefault } from "@/components/charts/radial-chart-default"
```

```tsx
<RadialChartDefault />
```

**React Native, SwiftUI, Jetpack Compose**

```tsx title="uniwind/components/charts/radial-chart-default.tsx"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  Cell,
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"

const chartConfig = {
  users: { label: "Users" },
  phone: { label: "Phone", color: "chart-1" },
  laptop: { label: "Laptop", color: "chart-2" },
  tablet: { label: "Tablet", color: "chart-3" },
  watch: { label: "Watch", color: "chart-4" },
} satisfies ChartConfig

type Device = "phone" | "laptop" | "tablet" | "watch"

const chartData: { device: Device; users: number }[] = [
  { device: "phone", users: 275 },
  { device: "laptop", users: 200 },
  { device: "tablet", users: 187 },
  { device: "watch", users: 173 },
]

export function RadialChartDefault() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Radial chart</CardTitle>
        <CardDescription>Users by device</CardDescription>
      </CardHeader>
      <CardContent>
        <ChartContainer
          config={chartConfig}
          accessibilityLabel="Radial chart"
          className="h-52 w-full"
        >
          <RadialBarChart
            data={chartData}
            innerRadius="25%"
            outerRadius="100%"
            barSize={12}
          >
            <ChartTooltip
              cursor={false}
              content={<ChartTooltipContent hideLabel nameKey="device" />}
            />
            <RadialBar
              dataKey="users"
              background={{ fill: "secondary" }}
              cornerRadius={10}
            >
              {chartData.map((item) => (
                <Cell key={item.device} fill={chartConfig[item.device].color} />
              ))}
            </RadialBar>
          </RadialBarChart>
        </ChartContainer>
      </CardContent>
    </Card>
  )
}
```

```swift title="swift/Charts/RadialChartDefault.swift"
import SwiftUI

private let chartData: [(device: String, users: Double)] = [
  ("phone", 275), ("laptop", 200), ("tablet", 187), ("watch", 173),
]

private let chartConfig: ChartConfig = [
  "users": .init("Users"),
  "phone": .init("Phone", color: EsuissColor.chart1),
  "laptop": .init("Laptop", color: EsuissColor.chart2),
  "tablet": .init("Tablet", color: EsuissColor.chart3),
  "watch": .init("Watch", color: EsuissColor.chart4),
]

public struct RadialChartDefault: View {
  @State private var selection: Int?

  public init() {}

  public var body: some View {
    Card(.filled, size: .sm) {
      CardHeader("Radial chart", description: "Users by device")
      CardContent {
        ChartContainer(config: chartConfig) {
          RadialBarChart(
            chartData.map { RadialBar($0.device, value: $0.users) },
            innerRadius: 0.25,
            outerRadius: 1,
            barSize: 12,
            rounded: true,
            track: .control,
            selection: $selection,
            accessibilityLabel: "Radial chart"
          ) { payload in
            ChartTooltipContent(payload, hideLabel: true)
          }
        }
        .frame(height: 208)
      }
    }
  }
}
```

```kt title="kotlin/charts/RadialChartDefault.kt"
package com.esuiss.ui.charts

import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Card
import com.esuiss.ui.components.CardContent
import com.esuiss.ui.components.CardHeader
import com.esuiss.ui.components.CardSize
import com.esuiss.ui.components.CardVariant
import com.esuiss.ui.components.ChartConfig
import com.esuiss.ui.components.ChartConfigItem
import com.esuiss.ui.components.ChartContainer
import com.esuiss.ui.components.ChartTooltipContent
import com.esuiss.ui.components.RadialBarChart
import com.esuiss.ui.theme.EsuissTheme

private class RadialDefaultDeviceUsers(val device: String, val users: Double)

private val chartData = listOf(
    RadialDefaultDeviceUsers("phone", 275.0),
    RadialDefaultDeviceUsers("laptop", 200.0),
    RadialDefaultDeviceUsers("tablet", 187.0),
    RadialDefaultDeviceUsers("watch", 173.0),
)

private val chartConfig = ChartConfig(
    "users" to ChartConfigItem("Users"),
    "phone" to ChartConfigItem("Phone") { chart1 },
    "laptop" to ChartConfigItem("Laptop") { chart2 },
    "tablet" to ChartConfigItem("Tablet") { chart3 },
    "watch" to ChartConfigItem("Watch") { chart4 },
)

@Composable
fun RadialChartDefault(modifier: Modifier = Modifier) {
    val colors = EsuissTheme.colors
    Card(modifier, variant = CardVariant.Filled, size = CardSize.Sm) {
        CardHeader("Radial chart", description = "Users by device")
        CardContent {
            ChartContainer(
                chartConfig,
                Modifier
                    .fillMaxWidth()
                    .height(208.dp),
            ) {
                RadialBarChart(
                    chartData,
                    innerRadius = 0.25f,
                    outerRadius = 1f,
                    barSize = 12.dp,
                    accessibilityLabel = "Radial chart",
                ) {
                    ChartTooltip { ChartTooltipContent(hideLabel = true) }
                    RadialBar("users", value = { it.users }, nameKey = { it.device }, background = colors.secondary, cornerRadius = 10.dp)
                }
            }
        }
    }
}
```

**React Native**

A `RadialBarChart` with one bar per record in `chartData` (a `device` and a `users` count). Each bar is colored through a `Cell` that reads `chartConfig`, over a track in the `secondary` color. Pressing a bar shows a tooltip.

Replace `chartData` with your records and add a matching entry per item to `chartConfig`, whose colors the `Cell` children read. The component takes no props.

**React Native, SwiftUI, Jetpack Compose**

### Installation

**Command**

**React Native**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-default
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-default
```

**SwiftUI**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-default
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-default --platform swift
```

**Jetpack Compose**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-default
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-default --platform kotlin
```

**React Native**

The CLI also adds what it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

**React Native, SwiftUI, Jetpack Compose**

**Manual**

**React Native**

**Uniwind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

2. Copy and paste the following code into `components/charts/radial-chart-default.tsx`:

- `uniwind/components/charts/radial-chart-default.tsx`: shown above

3. Update the import paths to match your project setup.

**NativeWind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

2. Copy and paste the following code into `components/charts/radial-chart-default.tsx`:

```tsx title="nativewind/components/charts/radial-chart-default.tsx"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  Cell,
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"

const chartConfig = {
  users: { label: "Users" },
  phone: { label: "Phone", color: "chart-1" },
  laptop: { label: "Laptop", color: "chart-2" },
  tablet: { label: "Tablet", color: "chart-3" },
  watch: { label: "Watch", color: "chart-4" },
} satisfies ChartConfig

type Device = "phone" | "laptop" | "tablet" | "watch"

const chartData: { device: Device; users: number }[] = [
  { device: "phone", users: 275 },
  { device: "laptop", users: 200 },
  { device: "tablet", users: 187 },
  { device: "watch", users: 173 },
]

export function RadialChartDefault() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Radial chart</CardTitle>
        <CardDescription>Users by device</CardDescription>
      </CardHeader>
      <CardContent>
        <ChartContainer
          config={chartConfig}
          accessibilityLabel="Radial chart"
          className="h-52 w-full"
        >
          <RadialBarChart
            data={chartData}
            innerRadius="25%"
            outerRadius="100%"
            barSize={12}
          >
            <ChartTooltip
              cursor={false}
              content={<ChartTooltipContent hideLabel nameKey="device" />}
            />
            <RadialBar
              dataKey="users"
              background={{ fill: "secondary" }}
              cornerRadius={10}
            >
              {chartData.map((item) => (
                <Cell key={item.device} fill={chartConfig[item.device].color} />
              ))}
            </RadialBar>
          </RadialBarChart>
        </ChartContainer>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**StyleSheet**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

2. Copy and paste the following code into `components/charts/radial-chart-default.tsx`:

```tsx title="stylesheet/components/charts/radial-chart-default.tsx"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  Cell,
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"

const chartConfig = {
  users: { label: "Users" },
  phone: { label: "Phone", color: "chart-1" },
  laptop: { label: "Laptop", color: "chart-2" },
  tablet: { label: "Tablet", color: "chart-3" },
  watch: { label: "Watch", color: "chart-4" },
} satisfies ChartConfig

type Device = "phone" | "laptop" | "tablet" | "watch"

const chartData: { device: Device; users: number }[] = [
  { device: "phone", users: 275 },
  { device: "laptop", users: 200 },
  { device: "tablet", users: 187 },
  { device: "watch", users: 173 },
]

export function RadialChartDefault() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Radial chart</CardTitle>
        <CardDescription>Users by device</CardDescription>
      </CardHeader>
      <CardContent>
        <ChartContainer
          config={chartConfig}
          accessibilityLabel="Radial chart"
          style={{ height: 208 }}
        >
          <RadialBarChart
            data={chartData}
            innerRadius="25%"
            outerRadius="100%"
            barSize={12}
          >
            <ChartTooltip
              cursor={false}
              content={<ChartTooltipContent hideLabel nameKey="device" />}
            />
            <RadialBar
              dataKey="users"
              background={{ fill: "secondary" }}
              cornerRadius={10}
            >
              {chartData.map((item) => (
                <Cell key={item.device} fill={chartConfig[item.device].color} />
              ))}
            </RadialBar>
          </RadialBarChart>
        </ChartContainer>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**SwiftUI**

1. Target iOS 17 or later.

2. Add the Swift package to your app:

```swift title="Package.swift"
.package(url: "https://github.com/phosphor-icons/swift", from: "2.1.0")
```

3. Copy the theme files every view uses:

- `swift/Theme/Theme.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Theme.swift)

- `swift/Theme/Tokens.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Tokens.swift)

4. Copy the source and every file it uses:

- `swift/Charts/RadialChartDefault.swift`: shown above

- `swift/Components/Card.swift`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `swift/Components/Chart.swift`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `swift/Components/Checkbox.swift`: see [Checkbox](https://suiss.app/ui/docs/components/checkbox.md)

- `swift/Components/Field.swift`: see [Field](https://suiss.app/ui/docs/components/field.md)

- `swift/Components/Haptics.swift`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `swift/Components/Item.swift`: see [Item](https://suiss.app/ui/docs/components/item.md)

- `swift/Components/Separator.swift`: see [Separator](https://suiss.app/ui/docs/components/separator.md)

5. Add the files to your app target.

**Jetpack Compose**

1. Apply the Compose compiler plugin, enable Compose, set `compileSdk` to 37 or higher and `minSdk` to 24 or higher, and add the dependencies:

```kotlin title="build.gradle.kts"
plugins {
    id("org.jetbrains.kotlin.plugin.compose")
}

android {
    compileSdk = 37
    defaultConfig { minSdk = 24 }
    buildFeatures { compose = true }
}

dependencies {
    implementation(platform("androidx.compose:compose-bom:2026.09.00"))
    implementation("androidx.compose.foundation:foundation")
    implementation("androidx.compose.ui:ui")
}
```

2. Copy the theme files every view uses:

- `kotlin/theme/Theme.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Theme.kt)

- `kotlin/theme/Tokens.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Tokens.kt)

3. Copy the source and every file it uses:

- `kotlin/charts/RadialChartDefault.kt`: shown above

- `kotlin/components/Card.kt`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `kotlin/components/Chart.kt`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `kotlin/components/Content.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/Content.kt)

- `kotlin/components/FormSupport.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/FormSupport.kt)

- `kotlin/components/Haptics.kt`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `kotlin/components/Icon.kt`: see [Icon](https://suiss.app/ui/docs/components/icon.md)

4. Update the `com.esuiss.ui` package names to match your project.

**React Native, SwiftUI, Jetpack Compose**

### Usage

**React Native**

```tsx
import { RadialChartDefault } from "@/components/charts/radial-chart-default"
```

```tsx
<RadialChartDefault />
```

**SwiftUI**

```swift
import SwiftUI

struct RadialExample: View {
  var body: some View {
    RadialChartDefault()
  }
}
```

**Jetpack Compose**

```kotlin
import androidx.compose.runtime.Composable
import com.esuiss.ui.charts.RadialChartDefault

@Composable
fun RadialExample() {
    RadialChartDefault()
}
```



## Radial Chart Batteries

A row of small battery rings, one per device, that turn red when charge is at or below 20%.

Source: https://suiss.app/ui/docs/charts/radial-chart#batteries

**React**

**Example**

```tsx title="components/charts/radial-chart-batteries.tsx"
"use client"

import { PolarAngleAxis, RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import { type ChartConfig, ChartContainer } from "@/components/ui/chart"

const devices = [
  { name: "Phone", level: 82 },
  { name: "Earbuds", level: 46 },
  { name: "Watch", level: 18 },
  { name: "Case", level: 100 },
]

const LOW = 20

function Battery({ name, level }: { name: string; level: number }) {
  const chartConfig = {
    level: {
      label: name,
      color: level <= LOW ? "var(--color-red-500)" : "var(--color-green-500)",
    },
  } satisfies ChartConfig

  return (
    <div className="flex flex-col items-center gap-2">
      <div className="relative size-16">
        <ChartContainer
          config={chartConfig}
          aria-hidden
          className="aspect-square size-full"
        >
          <RadialBarChart
            accessibilityLayer={false}
            data={[{ level, fill: "var(--color-level)" }]}
            innerRadius="78%"
            outerRadius="100%"
            startAngle={90}
            endAngle={-270}
            barSize={6}
          >
            <PolarAngleAxis type="number" domain={[0, 100]} tick={false} />
            <RadialBar
              dataKey="level"
              cornerRadius={6}
              isAnimationActive={false}
              background={{
                fill: "color-mix(in oklab, var(--color-level) 22%, transparent)",
              }}
            />
          </RadialBarChart>
        </ChartContainer>
        <span
          aria-hidden
          className="absolute inset-0 flex items-center justify-center text-xs font-semibold text-muted-foreground"
        >
          {name[0]}
        </span>
      </div>
      <span className="text-base font-semibold tabular-nums">{level}%</span>
      <span className="text-xs text-muted-foreground">{name}</span>
    </div>
  )
}

export function RadialChartBatteries() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Batteries</CardTitle>
        <CardDescription>Charge left on each device</CardDescription>
      </CardHeader>
      <CardContent>
        <ul className="grid grid-cols-4 gap-2 py-4">
          {devices.map((device) => (
            <li key={device.name}>
              <Battery {...device} />
            </li>
          ))}
        </ul>
      </CardContent>
    </Card>
  )
}
```

A row of small battery rings, one per device, that switch from green to red when the charge drops to the low threshold. Use compact rings like these for status at a glance, in widgets, settings pages or device lists.

Replace the `devices` array with your names and levels from 0 to 100. `LOW` sets the warning threshold, and the two colors live in the per-ring config. The letter in each ring is the first character of the name. The rings are hidden from assistive technology and have no tooltip, so the percentage and name under each ring carry the information.

### Installation

**Command**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-batteries
```

Works in any project with a `components.json`. See [Installation](https://suiss.app/ui/docs/installation#add-components) for the one-line registry setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-batteries
```

**Manual**

1. Install the following dependencies:

```bash title="Terminal"
npm install recharts
```

2. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

3. Copy and paste the following code into your project.

```tsx title="components/charts/radial-chart-batteries.tsx"
"use client"

import { PolarAngleAxis, RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import { type ChartConfig, ChartContainer } from "@/components/ui/chart"

const devices = [
  { name: "Phone", level: 82 },
  { name: "Earbuds", level: 46 },
  { name: "Watch", level: 18 },
  { name: "Case", level: 100 },
]

const LOW = 20

function Battery({ name, level }: { name: string; level: number }) {
  const chartConfig = {
    level: {
      label: name,
      color: level <= LOW ? "var(--color-red-500)" : "var(--color-green-500)",
    },
  } satisfies ChartConfig

  return (
    <div className="flex flex-col items-center gap-2">
      <div className="relative size-16">
        <ChartContainer
          config={chartConfig}
          aria-hidden
          className="aspect-square size-full"
        >
          <RadialBarChart
            accessibilityLayer={false}
            data={[{ level, fill: "var(--color-level)" }]}
            innerRadius="78%"
            outerRadius="100%"
            startAngle={90}
            endAngle={-270}
            barSize={6}
          >
            <PolarAngleAxis type="number" domain={[0, 100]} tick={false} />
            <RadialBar
              dataKey="level"
              cornerRadius={6}
              isAnimationActive={false}
              background={{
                fill: "color-mix(in oklab, var(--color-level) 22%, transparent)",
              }}
            />
          </RadialBarChart>
        </ChartContainer>
        <span
          aria-hidden
          className="absolute inset-0 flex items-center justify-center text-xs font-semibold text-muted-foreground"
        >
          {name[0]}
        </span>
      </div>
      <span className="text-base font-semibold tabular-nums">{level}%</span>
      <span className="text-xs text-muted-foreground">{name}</span>
    </div>
  )
}

export function RadialChartBatteries() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Batteries</CardTitle>
        <CardDescription>Charge left on each device</CardDescription>
      </CardHeader>
      <CardContent>
        <ul className="grid grid-cols-4 gap-2 py-4">
          {devices.map((device) => (
            <li key={device.name}>
              <Battery {...device} />
            </li>
          ))}
        </ul>
      </CardContent>
    </Card>
  )
}
```

4. Update the import paths to match your project setup.

### Usage

```tsx
import { RadialChartBatteries } from "@/components/charts/radial-chart-batteries"
```

```tsx
<RadialChartBatteries />
```

**React Native, SwiftUI, Jetpack Compose**

```tsx title="uniwind/components/charts/radial-chart-batteries.tsx"
import { View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"

const devices = [
  { name: "Phone", level: 82 },
  { name: "Earbuds", level: 46 },
  { name: "Watch", level: 18 },
  { name: "Case", level: 100 },
]

const LOW = 20

function Battery({ name, level }: { name: string; level: number }) {
  const chartConfig = {
    level: { label: name, color: level <= LOW ? "red-500" : "green-500" },
  } satisfies ChartConfig

  return (
    <View
      accessible
      accessibilityLabel={`${name}, ${level}%`}
      className="items-center gap-2"
    >
      <View className="size-16">
        <View
          pointerEvents="none"
          className="absolute inset-0 items-center justify-center"
        >
          <Text className="text-xs font-semibold text-muted-foreground">
            {name[0]}
          </Text>
        </View>
        <ChartContainer
          config={chartConfig}
          className="aspect-square size-full"
        >
          <RadialBarChart
            data={[{ level }]}
            innerRadius="78%"
            outerRadius="100%"
            startAngle={90}
            endAngle={-270}
            barSize={6}
          >
            <PolarAngleAxis domain={[0, 100]} />
            <RadialBar
              isAnimationActive={false}
              dataKey="level"
              cornerRadius={6}
              background={{ fillOpacity: 0.22 }}
            />
          </RadialBarChart>
        </ChartContainer>
      </View>
      <Text className="text-base font-semibold tabular-nums">{`${level}%`}</Text>
      <Text className="text-xs text-muted-foreground">{name}</Text>
    </View>
  )
}

export function RadialChartBatteries() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Batteries</CardTitle>
        <CardDescription>Charge left on each device</CardDescription>
      </CardHeader>
      <CardContent>
        <View className="flex-row gap-2 py-4">
          {devices.map((device) => (
            <View key={device.name} className="flex-1">
              <Battery {...device} />
            </View>
          ))}
        </View>
      </CardContent>
    </Card>
  )
}
```

```swift title="swift/Charts/RadialChartBatteries.swift"
import SwiftUI

private let devices: [(name: String, level: Double)] = [
  ("Phone", 82), ("Earbuds", 46), ("Watch", 18), ("Case", 100),
]

private let low: Double = 20

private struct Battery: View {
  let name: String
  let level: Double

  var body: some View {
    let chartConfig: ChartConfig = ["level": .init(name, color: level <= low ? Palette.red500 : Palette.green500)]
    VStack(spacing: 8) {
      ChartContainer(config: chartConfig) {
        RadialBarChart(
          [RadialBar("level", value: level)],
          domain: 0...100,
          innerRadius: 0.78,
          outerRadius: 1,
          barSize: 6,
          startAngle: .zero,
          endAngle: .degrees(360),
          rounded: true,
          track: .tint,
          isAnimationActive: false
        )
        .overlay {
          Text(verbatim: String(name.prefix(1)))
            .textStyle(.xs, weight: .semibold)
            .foregroundStyle(EsuissColor.mutedForeground)
        }
      }
      .frame(width: 64, height: 64)
      Text(verbatim: "\(Int(level))%")
        .textStyle(.base, weight: .semibold)
        .monospacedDigit()
      Text(LocalizedStringKey(name))
        .textStyle(.xs)
        .foregroundStyle(EsuissColor.mutedForeground)
    }
    .frame(maxWidth: .infinity)
    .accessibilityElement(children: .ignore)
    .accessibilityLabel(Text(LocalizedStringKey(name)))
    .accessibilityValue(Text(verbatim: "\(Int(level))%"))
  }
}

public struct RadialChartBatteries: View {
  public init() {}

  public var body: some View {
    Card(.filled, size: .sm) {
      CardHeader("Batteries", description: "Charge left on each device")
      CardContent {
        HStack(alignment: .top, spacing: 8) {
          ForEach(devices, id: \.name) { device in
            Battery(name: device.name, level: device.level)
          }
        }
        .padding(.vertical, 16)
      }
    }
  }
}
```

```kt title="kotlin/charts/RadialChartBatteries.kt"
package com.esuiss.ui.charts

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.text.BasicText
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Card
import com.esuiss.ui.components.CardContent
import com.esuiss.ui.components.CardHeader
import com.esuiss.ui.components.CardSize
import com.esuiss.ui.components.CardVariant
import com.esuiss.ui.components.ChartConfig
import com.esuiss.ui.components.ChartConfigItem
import com.esuiss.ui.components.ChartContainer
import com.esuiss.ui.components.RadialBarChart
import com.esuiss.ui.components.chartColor
import com.esuiss.ui.theme.EsuissTheme
import com.esuiss.ui.theme.Palette
import com.esuiss.ui.theme.Typography

private class RadialBatteriesDevice(val name: String, val level: Double)

private val devices = listOf(
    RadialBatteriesDevice("Phone", 82.0),
    RadialBatteriesDevice("Earbuds", 46.0),
    RadialBatteriesDevice("Watch", 18.0),
    RadialBatteriesDevice("Case", 100.0),
)

private const val LOW = 20.0

@Composable
private fun Battery(device: RadialBatteriesDevice, modifier: Modifier = Modifier) {
    val colors = EsuissTheme.colors
    val low = device.level <= LOW
    val chartConfig = ChartConfig("level" to ChartConfigItem(device.name) { if (low) Palette.red500 else Palette.green500 })
    Column(
        modifier.clearAndSetSemantics { contentDescription = "${device.name}, ${device.level.toInt()}%" },
        horizontalAlignment = Alignment.CenterHorizontally,
        verticalArrangement = Arrangement.spacedBy(8.dp),
    ) {
        Box(Modifier.size(64.dp), contentAlignment = Alignment.Center) {
            ChartContainer(chartConfig, Modifier.matchParentSize()) {
                val color = chartColor("level")
                RadialBarChart(
                    listOf(device),
                    innerRadius = 0.78f,
                    outerRadius = 1f,
                    startAngle = 90f,
                    endAngle = -270f,
                    barSize = 6.dp,
                ) {
                    PolarAngleAxis(0.0..100.0)
                    RadialBar("level", value = { it.level }, cornerRadius = 6.dp, background = color.copy(alpha = color.alpha * 0.22f), isAnimationActive = false)
                }
            }
            BasicText(
                device.name.take(1),
                style = Typography.xs.copy(color = colors.mutedForeground, fontWeight = FontWeight.SemiBold),
            )
        }
        BasicText(
            "${device.level.toInt()}%",
            style = Typography.base.copy(color = colors.foreground, fontWeight = FontWeight.SemiBold, fontFeatureSettings = "tnum"),
        )
        BasicText(device.name, style = Typography.xs.copy(color = colors.mutedForeground))
    }
}

@Composable
fun RadialChartBatteries(modifier: Modifier = Modifier) {
    Card(modifier, variant = CardVariant.Filled, size = CardSize.Sm) {
        CardHeader("Batteries", description = "Charge left on each device")
        CardContent {
            Row(
                Modifier.padding(vertical = 16.dp),
                horizontalArrangement = Arrangement.spacedBy(8.dp),
            ) {
                for (device in devices) Battery(device, Modifier.weight(1f))
            }
        }
    }
}
```

**React Native**

A `Card` that renders one `RadialBarChart` ring per entry in `devices`, each with a level from 0 to 100. A ring turns red at or below `LOW` (20%) and is green otherwise, with the device initial in the center and its percentage and name below. Each gauge is a single accessible element labeled with name and level. Nothing is interactive. The rings set `isAnimationActive={false}` and draw without the enter animation.

Replace `devices` with your names and levels, and change `LOW` to move the warning threshold. The component takes no props.

**React Native, SwiftUI, Jetpack Compose**

### Installation

**Command**

**React Native**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-batteries
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-batteries
```

**SwiftUI**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-batteries
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-batteries --platform swift
```

**Jetpack Compose**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-batteries
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-batteries --platform kotlin
```

**React Native**

The CLI also adds what it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

**React Native, SwiftUI, Jetpack Compose**

**Manual**

**React Native**

**Uniwind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

2. Copy and paste the following code into `components/charts/radial-chart-batteries.tsx`:

- `uniwind/components/charts/radial-chart-batteries.tsx`: shown above

3. Update the import paths to match your project setup.

**NativeWind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

2. Copy and paste the following code into `components/charts/radial-chart-batteries.tsx`:

```tsx title="nativewind/components/charts/radial-chart-batteries.tsx"
import { View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"

const devices = [
  { name: "Phone", level: 82 },
  { name: "Earbuds", level: 46 },
  { name: "Watch", level: 18 },
  { name: "Case", level: 100 },
]

const LOW = 20

function Battery({ name, level }: { name: string; level: number }) {
  const chartConfig = {
    level: { label: name, color: level <= LOW ? "red-500" : "green-500" },
  } satisfies ChartConfig

  return (
    <View
      accessible
      accessibilityLabel={`${name}, ${level}%`}
      className="items-center gap-2"
    >
      <View className="size-16">
        <View
          pointerEvents="none"
          className="absolute inset-0 items-center justify-center"
        >
          <Text className="text-xs font-semibold text-muted-foreground">
            {name[0]}
          </Text>
        </View>
        <ChartContainer
          config={chartConfig}
          className="aspect-square size-full"
        >
          <RadialBarChart
            data={[{ level }]}
            innerRadius="78%"
            outerRadius="100%"
            startAngle={90}
            endAngle={-270}
            barSize={6}
          >
            <PolarAngleAxis domain={[0, 100]} />
            <RadialBar
              isAnimationActive={false}
              dataKey="level"
              cornerRadius={6}
              background={{ fillOpacity: 0.22 }}
            />
          </RadialBarChart>
        </ChartContainer>
      </View>
      <Text className="text-base font-semibold tabular-nums">{`${level}%`}</Text>
      <Text className="text-xs text-muted-foreground">{name}</Text>
    </View>
  )
}

export function RadialChartBatteries() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Batteries</CardTitle>
        <CardDescription>Charge left on each device</CardDescription>
      </CardHeader>
      <CardContent>
        <View className="flex-row gap-2 py-4">
          {devices.map((device) => (
            <View key={device.name} className="flex-1">
              <Battery {...device} />
            </View>
          ))}
        </View>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**StyleSheet**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

2. Copy and paste the following code into `components/charts/radial-chart-batteries.tsx`:

```tsx title="stylesheet/components/charts/radial-chart-batteries.tsx"
import { StyleSheet, View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"
import { fontSize, useTheme } from "@/components/ui/theme"

const devices = [
  { name: "Phone", level: 82 },
  { name: "Earbuds", level: 46 },
  { name: "Watch", level: 18 },
  { name: "Case", level: 100 },
]

const LOW = 20

const styles = StyleSheet.create({
  battery: { alignItems: "center", gap: 8 },
  ring: { width: 64, height: 64 },
  overlay: {
    ...StyleSheet.absoluteFill,
    alignItems: "center",
    justifyContent: "center",
  },
  initial: { ...fontSize.xs, fontWeight: "600" },
  chart: { width: "100%", height: "100%", aspectRatio: 1 },
  level: { ...fontSize.base, fontWeight: "600", fontVariant: ["tabular-nums"] },
  name: { ...fontSize.xs },
  list: { flexDirection: "row", gap: 8, paddingVertical: 16 },
  item: { flex: 1 },
})

function Battery({ name, level }: { name: string; level: number }) {
  const { colors } = useTheme()
  const chartConfig = {
    level: { label: name, color: level <= LOW ? "red-500" : "green-500" },
  } satisfies ChartConfig

  return (
    <View
      accessible
      accessibilityLabel={`${name}, ${level}%`}
      style={styles.battery}
    >
      <View style={styles.ring}>
        <View pointerEvents="none" style={styles.overlay}>
          <Text style={[styles.initial, { color: colors.mutedForeground }]}>
            {name[0]}
          </Text>
        </View>
        <ChartContainer config={chartConfig} style={styles.chart}>
          <RadialBarChart
            data={[{ level }]}
            innerRadius="78%"
            outerRadius="100%"
            startAngle={90}
            endAngle={-270}
            barSize={6}
          >
            <PolarAngleAxis domain={[0, 100]} />
            <RadialBar
              isAnimationActive={false}
              dataKey="level"
              cornerRadius={6}
              background={{ fillOpacity: 0.22 }}
            />
          </RadialBarChart>
        </ChartContainer>
      </View>
      <Text style={styles.level}>{`${level}%`}</Text>
      <Text style={[styles.name, { color: colors.mutedForeground }]}>
        {name}
      </Text>
    </View>
  )
}

export function RadialChartBatteries() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Batteries</CardTitle>
        <CardDescription>Charge left on each device</CardDescription>
      </CardHeader>
      <CardContent>
        <View style={styles.list}>
          {devices.map((device) => (
            <View key={device.name} style={styles.item}>
              <Battery {...device} />
            </View>
          ))}
        </View>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**SwiftUI**

1. Target iOS 17 or later.

2. Copy the theme files every view uses:

- `swift/Theme/Theme.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Theme.swift)

- `swift/Theme/Tokens.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Tokens.swift)

3. Copy the source and every file it uses:

- `swift/Charts/RadialChartBatteries.swift`: shown above

- `swift/Components/Card.swift`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `swift/Components/Chart.swift`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `swift/Components/Haptics.swift`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `swift/Components/Item.swift`: see [Item](https://suiss.app/ui/docs/components/item.md)

- `swift/Components/Separator.swift`: see [Separator](https://suiss.app/ui/docs/components/separator.md)

4. Add the files to your app target.

**Jetpack Compose**

1. Apply the Compose compiler plugin, enable Compose, set `compileSdk` to 37 or higher and `minSdk` to 24 or higher, and add the dependencies:

```kotlin title="build.gradle.kts"
plugins {
    id("org.jetbrains.kotlin.plugin.compose")
}

android {
    compileSdk = 37
    defaultConfig { minSdk = 24 }
    buildFeatures { compose = true }
}

dependencies {
    implementation(platform("androidx.compose:compose-bom:2026.09.00"))
    implementation("androidx.compose.foundation:foundation")
    implementation("androidx.compose.ui:ui")
}
```

2. Copy the theme files every view uses:

- `kotlin/theme/Theme.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Theme.kt)

- `kotlin/theme/Tokens.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Tokens.kt)

3. Copy the source and every file it uses:

- `kotlin/charts/RadialChartBatteries.kt`: shown above

- `kotlin/components/Card.kt`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `kotlin/components/Chart.kt`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `kotlin/components/Content.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/Content.kt)

- `kotlin/components/FormSupport.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/FormSupport.kt)

- `kotlin/components/Haptics.kt`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `kotlin/components/Icon.kt`: see [Icon](https://suiss.app/ui/docs/components/icon.md)

4. Update the `com.esuiss.ui` package names to match your project.

**React Native, SwiftUI, Jetpack Compose**

### Usage

**React Native**

```tsx
import { RadialChartBatteries } from "@/components/charts/radial-chart-batteries"
```

```tsx
<RadialChartBatteries />
```

**SwiftUI**

```swift
import SwiftUI

struct RadialBatteriesExample: View {
  var body: some View {
    RadialChartBatteries()
  }
}
```

**Jetpack Compose**

```kotlin
import androidx.compose.runtime.Composable
import com.esuiss.ui.charts.RadialChartBatteries

@Composable
fun RadialBatteriesExample() {
    RadialChartBatteries()
}
```



## Radial Chart Gauge

A 240-degree gauge arc showing an air quality reading with its value and rating below the center.

Source: https://suiss.app/ui/docs/charts/radial-chart#gauge

**React**

**Example**

```tsx title="components/charts/radial-chart-gauge.tsx"
"use client"

import { PolarAngleAxis, RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import { type ChartConfig, ChartContainer } from "@/components/ui/chart"

const chartData = [{ name: "value", value: 38, fill: "var(--color-value)" }]

const chartConfig = {
  value: { label: "Air quality", color: "var(--color-green-500)" },
} satisfies ChartConfig

export function RadialChartGauge() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Gauge</CardTitle>
        <CardDescription>Air quality index</CardDescription>
      </CardHeader>
      <CardContent>
        <div className="relative">
          <ChartContainer
            config={chartConfig}
            className="aspect-auto h-52 w-full"
          >
            <RadialBarChart
              accessibilityLayer={false}
              data={chartData}
              innerRadius="72%"
              outerRadius="100%"
              startAngle={210}
              endAngle={-30}
              barSize={14}
            >
              <PolarAngleAxis
                type="number"
                domain={[0, 100]}
                tick={false}
                axisLine={false}
              />
              <RadialBar
                dataKey="value"
                cornerRadius={20}
                background={{
                  fill: "color-mix(in oklab, var(--color-value) 22%, transparent)",
                }}
              />
            </RadialBarChart>
          </ChartContainer>
          <div className="pointer-events-none absolute inset-x-0 top-[44%] justify-center flex flex-col items-center text-center">
            <span className="text-3xl font-semibold tracking-tight tabular-nums">
              38
            </span>
            <span className="text-xs text-muted-foreground">Good</span>
          </div>
        </div>
      </CardContent>
    </Card>
  )
}
```

A gauge-style arc that opens at the bottom, showing a single reading with its value and rating in the center. Use it for scores with a known range, such as air quality, health scores or credit utilization.

Set the reading in `chartData` and the scale through the `domain` on `PolarAngleAxis`. The number and rating in the center are static text, so keep them in sync with the value. Change the color in `chartConfig`, or pick it from the value to signal good and bad ranges. There is no tooltip.

### Installation

**Command**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-gauge
```

Works in any project with a `components.json`. See [Installation](https://suiss.app/ui/docs/installation#add-components) for the one-line registry setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-gauge
```

**Manual**

1. Install the following dependencies:

```bash title="Terminal"
npm install recharts
```

2. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

3. Copy and paste the following code into your project.

```tsx title="components/charts/radial-chart-gauge.tsx"
"use client"

import { PolarAngleAxis, RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import { type ChartConfig, ChartContainer } from "@/components/ui/chart"

const chartData = [{ name: "value", value: 38, fill: "var(--color-value)" }]

const chartConfig = {
  value: { label: "Air quality", color: "var(--color-green-500)" },
} satisfies ChartConfig

export function RadialChartGauge() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Gauge</CardTitle>
        <CardDescription>Air quality index</CardDescription>
      </CardHeader>
      <CardContent>
        <div className="relative">
          <ChartContainer
            config={chartConfig}
            className="aspect-auto h-52 w-full"
          >
            <RadialBarChart
              accessibilityLayer={false}
              data={chartData}
              innerRadius="72%"
              outerRadius="100%"
              startAngle={210}
              endAngle={-30}
              barSize={14}
            >
              <PolarAngleAxis
                type="number"
                domain={[0, 100]}
                tick={false}
                axisLine={false}
              />
              <RadialBar
                dataKey="value"
                cornerRadius={20}
                background={{
                  fill: "color-mix(in oklab, var(--color-value) 22%, transparent)",
                }}
              />
            </RadialBarChart>
          </ChartContainer>
          <div className="pointer-events-none absolute inset-x-0 top-[44%] justify-center flex flex-col items-center text-center">
            <span className="text-3xl font-semibold tracking-tight tabular-nums">
              38
            </span>
            <span className="text-xs text-muted-foreground">Good</span>
          </div>
        </div>
      </CardContent>
    </Card>
  )
}
```

4. Update the import paths to match your project setup.

### Usage

```tsx
import { RadialChartGauge } from "@/components/charts/radial-chart-gauge"
```

```tsx
<RadialChartGauge />
```

**React Native, SwiftUI, Jetpack Compose**

```tsx title="uniwind/components/charts/radial-chart-gauge.tsx"
import { View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"

const chartData = [{ name: "value", value: 38 }]

const chartConfig = {
  value: { label: "Air quality", color: "green-500" },
} satisfies ChartConfig

export function RadialChartGauge() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Gauge</CardTitle>
        <CardDescription>Air quality index</CardDescription>
      </CardHeader>
      <CardContent>
        <View>
          <View
            pointerEvents="none"
            className="absolute inset-x-0 top-[44%] items-center"
          >
            <Text className="text-3xl font-semibold tracking-tight tabular-nums">
              38
            </Text>
            <Text className="text-xs text-muted-foreground">Good</Text>
          </View>
          <ChartContainer
            config={chartConfig}
            accessibilityLabel="Gauge"
            className="h-52 w-full"
          >
            <RadialBarChart
              data={chartData}
              innerRadius="72%"
              outerRadius="100%"
              startAngle={210}
              endAngle={-30}
              barSize={14}
            >
              <PolarAngleAxis domain={[0, 100]} />
              <RadialBar
                dataKey="value"
                cornerRadius={20}
                background={{ fillOpacity: 0.22 }}
              />
            </RadialBarChart>
          </ChartContainer>
        </View>
      </CardContent>
    </Card>
  )
}
```

```swift title="swift/Charts/RadialChartGauge.swift"
import SwiftUI

private let chartConfig: ChartConfig = [
  "value": .init("Air quality", color: Palette.green500),
]

public struct RadialChartGauge: View {
  public init() {}

  public var body: some View {
    Card(.filled, size: .sm) {
      CardHeader("Gauge", description: "Air quality index")
      CardContent {
        ChartContainer(config: chartConfig) {
          RadialBarChart(
            [RadialBar("value", value: 38)],
            domain: 0...100,
            innerRadius: 0.72,
            outerRadius: 1,
            barSize: 14,
            startAngle: .degrees(-120),
            endAngle: .degrees(120),
            rounded: true,
            track: .tint
          )
          .overlay(alignment: .top) {
            VStack(spacing: 0) {
              Text(verbatim: "38")
                .textStyle(.xl3, weight: .semibold)
                .monospacedDigit()
              Text("Good")
                .textStyle(.xs)
                .foregroundStyle(EsuissColor.mutedForeground)
            }
            .multilineTextAlignment(.center)
            .padding(.top, 208 * 0.44)
          }
        }
        .frame(height: 208)
        .accessibilityElement(children: .ignore)
        .accessibilityLabel(Text("Gauge"))
        .accessibilityValue(Text("Air quality 38, Good"))
      }
    }
  }
}
```

```kt title="kotlin/charts/RadialChartGauge.kt"
package com.esuiss.ui.charts

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.text.BasicText
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Card
import com.esuiss.ui.components.CardContent
import com.esuiss.ui.components.CardHeader
import com.esuiss.ui.components.CardSize
import com.esuiss.ui.components.CardVariant
import com.esuiss.ui.components.ChartConfig
import com.esuiss.ui.components.ChartConfigItem
import com.esuiss.ui.components.ChartContainer
import com.esuiss.ui.components.RadialBarChart
import com.esuiss.ui.components.chartColor
import com.esuiss.ui.theme.EsuissTheme
import com.esuiss.ui.theme.Palette
import com.esuiss.ui.theme.Typography

private class RadialGaugeReading(val value: Double)

private val chartData = listOf(RadialGaugeReading(38.0))

private val chartConfig = ChartConfig(
    "value" to ChartConfigItem("Air quality") { Palette.green500 },
)

@Composable
fun RadialChartGauge(modifier: Modifier = Modifier) {
    val colors = EsuissTheme.colors
    Card(modifier, variant = CardVariant.Filled, size = CardSize.Sm) {
        CardHeader("Gauge", description = "Air quality index")
        CardContent {
            Box(
                Modifier
                    .fillMaxWidth()
                    .height(208.dp),
            ) {
                ChartContainer(chartConfig, Modifier.matchParentSize()) {
                    val color = chartColor("value")
                    RadialBarChart(
                        chartData,
                        innerRadius = 0.72f,
                        outerRadius = 1f,
                        startAngle = 210f,
                        endAngle = -30f,
                        barSize = 14.dp,
                        accessibilityLabel = "Gauge, 38 Good",
                    ) {
                        PolarAngleAxis(0.0..100.0)
                        RadialBar("value", value = { it.value }, cornerRadius = 20.dp, background = color.copy(alpha = color.alpha * 0.22f))
                    }
                }
                Column(
                    Modifier
                        .align(Alignment.TopCenter)
                        .padding(top = 91.5.dp)
                        .clearAndSetSemantics {},
                    horizontalAlignment = Alignment.CenterHorizontally,
                ) {
                    BasicText(
                        "38",
                        style = Typography.xl3.copy(color = colors.foreground, fontWeight = FontWeight.SemiBold, fontFeatureSettings = "tnum"),
                    )
                    BasicText("Good", style = Typography.xs.copy(color = colors.mutedForeground))
                }
            }
        }
    }
}
```

**React Native, SwiftUI**

A `RadialBarChart` drawn from 210 to -30 degrees, with a single value on a 0 to 100 `PolarAngleAxis` and a tinted track behind it. The number and its rating are `Text` layered over the arc. Nothing is interactive.

**React Native**

Change the `value` in `chartData` (0 to 100) and the centered text to match it; the label and color live in `chartConfig`. The component takes no props.

**React Native, SwiftUI, Jetpack Compose**

### Installation

**Command**

**React Native**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-gauge
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-gauge
```

**SwiftUI**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-gauge
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-gauge --platform swift
```

**Jetpack Compose**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-gauge
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-gauge --platform kotlin
```

**React Native**

The CLI also adds what it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

**React Native, SwiftUI, Jetpack Compose**

**Manual**

**React Native**

**Uniwind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

2. Copy and paste the following code into `components/charts/radial-chart-gauge.tsx`:

- `uniwind/components/charts/radial-chart-gauge.tsx`: shown above

3. Update the import paths to match your project setup.

**NativeWind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

2. Copy and paste the following code into `components/charts/radial-chart-gauge.tsx`:

```tsx title="nativewind/components/charts/radial-chart-gauge.tsx"
import { View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"

const chartData = [{ name: "value", value: 38 }]

const chartConfig = {
  value: { label: "Air quality", color: "green-500" },
} satisfies ChartConfig

export function RadialChartGauge() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Gauge</CardTitle>
        <CardDescription>Air quality index</CardDescription>
      </CardHeader>
      <CardContent>
        <View>
          <View
            pointerEvents="none"
            className="absolute inset-x-0 top-[44%] items-center"
          >
            <Text className="text-3xl font-semibold tracking-tight tabular-nums">
              38
            </Text>
            <Text className="text-xs text-muted-foreground">Good</Text>
          </View>
          <ChartContainer
            config={chartConfig}
            accessibilityLabel="Gauge"
            className="h-52 w-full"
          >
            <RadialBarChart
              data={chartData}
              innerRadius="72%"
              outerRadius="100%"
              startAngle={210}
              endAngle={-30}
              barSize={14}
            >
              <PolarAngleAxis domain={[0, 100]} />
              <RadialBar
                dataKey="value"
                cornerRadius={20}
                background={{ fillOpacity: 0.22 }}
              />
            </RadialBarChart>
          </ChartContainer>
        </View>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**StyleSheet**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

2. Copy and paste the following code into `components/charts/radial-chart-gauge.tsx`:

```tsx title="stylesheet/components/charts/radial-chart-gauge.tsx"
import { StyleSheet, View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"
import { fontSize, useTheme } from "@/components/ui/theme"

const chartData = [{ name: "value", value: 38 }]

const chartConfig = {
  value: { label: "Air quality", color: "green-500" },
} satisfies ChartConfig

const styles = StyleSheet.create({
  overlay: {
    position: "absolute",
    left: 0,
    right: 0,
    top: "44%",
    alignItems: "center",
  },
  value: {
    ...fontSize["3xl"],
    fontWeight: "600",
    letterSpacing: -0.75,
    fontVariant: ["tabular-nums"],
  },
  caption: { ...fontSize.xs },
  chart: { height: 208 },
})

export function RadialChartGauge() {
  const { colors } = useTheme()
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Gauge</CardTitle>
        <CardDescription>Air quality index</CardDescription>
      </CardHeader>
      <CardContent>
        <View>
          <View pointerEvents="none" style={styles.overlay}>
            <Text style={styles.value}>38</Text>
            <Text style={[styles.caption, { color: colors.mutedForeground }]}>
              Good
            </Text>
          </View>
          <ChartContainer
            config={chartConfig}
            accessibilityLabel="Gauge"
            style={styles.chart}
          >
            <RadialBarChart
              data={chartData}
              innerRadius="72%"
              outerRadius="100%"
              startAngle={210}
              endAngle={-30}
              barSize={14}
            >
              <PolarAngleAxis domain={[0, 100]} />
              <RadialBar
                dataKey="value"
                cornerRadius={20}
                background={{ fillOpacity: 0.22 }}
              />
            </RadialBarChart>
          </ChartContainer>
        </View>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**SwiftUI**

1. Target iOS 17 or later.

2. Copy the theme files every view uses:

- `swift/Theme/Theme.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Theme.swift)

- `swift/Theme/Tokens.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Tokens.swift)

3. Copy the source and every file it uses:

- `swift/Charts/RadialChartGauge.swift`: shown above

- `swift/Components/Card.swift`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `swift/Components/Chart.swift`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `swift/Components/Haptics.swift`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `swift/Components/Item.swift`: see [Item](https://suiss.app/ui/docs/components/item.md)

- `swift/Components/Separator.swift`: see [Separator](https://suiss.app/ui/docs/components/separator.md)

4. Add the files to your app target.

**Jetpack Compose**

1. Apply the Compose compiler plugin, enable Compose, set `compileSdk` to 37 or higher and `minSdk` to 24 or higher, and add the dependencies:

```kotlin title="build.gradle.kts"
plugins {
    id("org.jetbrains.kotlin.plugin.compose")
}

android {
    compileSdk = 37
    defaultConfig { minSdk = 24 }
    buildFeatures { compose = true }
}

dependencies {
    implementation(platform("androidx.compose:compose-bom:2026.09.00"))
    implementation("androidx.compose.foundation:foundation")
    implementation("androidx.compose.ui:ui")
}
```

2. Copy the theme files every view uses:

- `kotlin/theme/Theme.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Theme.kt)

- `kotlin/theme/Tokens.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Tokens.kt)

3. Copy the source and every file it uses:

- `kotlin/charts/RadialChartGauge.kt`: shown above

- `kotlin/components/Card.kt`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `kotlin/components/Chart.kt`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `kotlin/components/Content.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/Content.kt)

- `kotlin/components/FormSupport.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/FormSupport.kt)

- `kotlin/components/Haptics.kt`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `kotlin/components/Icon.kt`: see [Icon](https://suiss.app/ui/docs/components/icon.md)

4. Update the `com.esuiss.ui` package names to match your project.

**React Native, SwiftUI, Jetpack Compose**

### Usage

**React Native**

```tsx
import { RadialChartGauge } from "@/components/charts/radial-chart-gauge"
```

```tsx
<RadialChartGauge />
```

**SwiftUI**

```swift
import SwiftUI

struct RadialGaugeExample: View {
  var body: some View {
    RadialChartGauge()
  }
}
```

**Jetpack Compose**

```kotlin
import androidx.compose.runtime.Composable
import com.esuiss.ui.charts.RadialChartGauge

@Composable
fun RadialGaugeExample() {
    RadialChartGauge()
}
```



## Radial Chart Interactive

A weekly activity view where picking a day animates three large rings and updates each ring's totals.

Source: https://suiss.app/ui/docs/charts/radial-chart#interactive

**React**

**Example**

```tsx title="components/charts/radial-chart-interactive.tsx"
"use client"

import * as React from "react"

import { Card, CardContent, CardHeader } from "@/components/ui/card"
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"

type Ring = "move" | "exercise" | "stand"

const RINGS: {
  key: Ring
  label: string
  unit: string
  goal: number
  color: string
}[] = [
  {
    key: "move",
    label: "Move",
    unit: "kcal",
    goal: 600,
    color: "var(--color-red-500)",
  },
  {
    key: "exercise",
    label: "Exercise",
    unit: "min",
    goal: 30,
    color: "var(--color-green-500)",
  },
  {
    key: "stand",
    label: "Stand",
    unit: "hr",
    goal: 12,
    color: "var(--color-cyan-500)",
  },
]

const WEEK = [
  { day: "Monday", values: [520, 34, 11] },
  { day: "Tuesday", values: [610, 42, 12] },
  { day: "Wednesday", values: [380, 18, 9] },
  { day: "Thursday", values: [640, 45, 12] },
  { day: "Friday", values: [470, 28, 10] },
  { day: "Saturday", values: [720, 62, 12] },
  { day: "Sunday", values: [486, 24, 10] },
]

const FILL_DURATION = 750

const NO_ACTIVITY = RINGS.map(() => 0)

function useMorph(target: number[]) {
  const [values, setValues] = React.useState(() => target.map(() => 0))
  const valuesRef = React.useRef(values)

  React.useEffect(() => {
    const from = valuesRef.current
    const reduced = window.matchMedia(
      "(prefers-reduced-motion: reduce)"
    ).matches
    const start = performance.now()
    let frame = 0
    const step = () => {
      const progress = reduced
        ? 1
        : Math.min(1, (performance.now() - start) / FILL_DURATION)
      const eased =
        progress < 0.5 ? 4 * progress ** 3 : 1 - (-2 * progress + 2) ** 3 / 2
      const next =
        progress < 1
          ? target.map((value, index) => {
              const origin = from[index] ?? value
              return origin + (value - origin) * eased
            })
          : target
      valuesRef.current = next
      setValues(next)
      if (progress < 1) frame = requestAnimationFrame(step)
    }
    frame = requestAnimationFrame(step)
    return () => cancelAnimationFrame(frame)
  }, [target])

  return values
}

function Rings({
  values,
  size,
  bar,
  className,
}: {
  values: number[]
  size: number
  bar: number
  className?: string
}) {
  return (
    <svg
      aria-hidden
      viewBox={`0 0 ${size} ${size}`}
      className={className}
      style={{ rotate: "-90deg" }}
    >
      {RINGS.map((ring, index) => {
        const radius =
          size / 2 - bar / 2 - index * (bar + Math.max(1, bar * 0.12))
        const circumference = 2 * Math.PI * radius
        const progress = Math.max(
          0,
          Math.min(1, (values[index] ?? 0) / ring.goal)
        )
        return (
          <g key={ring.key}>
            <circle
              cx={size / 2}
              cy={size / 2}
              r={radius}
              fill="none"
              strokeWidth={bar}
              stroke={`color-mix(in oklab, ${ring.color} 22%, transparent)`}
            />
            {progress > 0.001 && (
              <circle
                cx={size / 2}
                cy={size / 2}
                r={radius}
                fill="none"
                strokeWidth={bar}
                strokeLinecap="round"
                stroke={ring.color}
                strokeDasharray={`${progress * circumference} ${circumference}`}
              />
            )}
          </g>
        )
      })}
    </svg>
  )
}

export function RadialChartInteractive() {
  const [selected, setSelected] = React.useState(6)
  const target = WEEK[selected]?.values ?? NO_ACTIVITY
  const values = useMorph(target)

  return (
    <Card variant="filled" size="sm" className="[--card-spacing:--spacing(5)]">
      <CardHeader className="gap-0.5">
        <p className="text-lg font-semibold">Activity</p>
        <p className="text-sm text-muted-foreground">This week · pick a day</p>
      </CardHeader>
      <CardContent className="flex flex-col gap-6">
        <ToggleGroup
          spacing={1}
          value={[String(selected)]}
          onValueChange={(value: string[]) => {
            if (value[0] !== undefined) setSelected(Number(value[0]))
          }}
          aria-label="Day"
          className="grid w-full grid-cols-7"
        >
          {WEEK.map((entry, index) => (
            <ToggleGroupItem
              key={entry.day}
              value={String(index)}
              aria-label={entry.day}
              className="h-auto flex-col gap-1.5 rounded-xl px-0 py-2 text-xs font-semibold text-muted-foreground aria-pressed:bg-background aria-pressed:text-foreground aria-pressed:hover:bg-background aria-pressed:hover:text-foreground"
            >
              {entry.day.slice(0, 3)}
              <Rings
                values={entry.values}
                size={40}
                bar={4}
                className="size-10"
              />
            </ToggleGroupItem>
          ))}
        </ToggleGroup>
        <div className="flex flex-wrap items-center justify-center gap-8">
          <Rings
            values={values}
            size={260}
            bar={24}
            className="size-65 max-w-full"
          />
          <p className="sr-only" aria-live="polite">
            {WEEK[selected]?.day}:{" "}
            {RINGS.map(
              (ring, index) =>
                `${ring.label} ${target[index] ?? 0} of ${ring.goal} ${ring.unit}`
            ).join(", ")}
          </p>
          <dl className="flex min-w-44 flex-col gap-4">
            {RINGS.map((ring, index) => {
              const percent = Math.round(
                ((target[index] ?? 0) / ring.goal) * 100
              )
              return (
                <div key={ring.key} className="flex flex-col gap-0.5">
                  <dt className="text-base font-semibold">{ring.label}</dt>
                  <dd
                    className="flex items-baseline gap-0.5 text-[color-mix(in_oklab,var(--ring),var(--foreground)_45%)] dark:text-(--ring)"
                    style={{ "--ring": ring.color } as React.CSSProperties}
                  >
                    <span className="text-3xl font-semibold tracking-tight tabular-nums">
                      {Math.round(values[index] ?? 0)}/{ring.goal}
                    </span>
                    <span className="text-base font-semibold uppercase">
                      {ring.unit}
                    </span>
                  </dd>
                  <dd className="text-xs text-muted-foreground">
                    {percent}%{percent >= 100 ? " · goal met" : ""}
                  </dd>
                </div>
              )
            })}
          </dl>
        </div>
      </CardContent>
    </Card>
  )
}
```

An activity summary with a strip of seven day buttons, each showing mini rings, and large Move, Exercise and Stand rings that fill to the selected day's values. Totals and goal progress for each ring update next to it. Use it as a pattern for daily goals that readers browse day by day.

Replace `WEEK` with your days and values, one number per ring in the order of `RINGS`, and edit `RINGS` for labels, units, goals and colors. The `selected` state sets the first selected day. The rings are plain SVG, not a Recharts chart, so there is no tooltip; values beyond the goal show a full ring while the text reports the real percentage. Day buttons work with the keyboard, the totals are announced through a live region, and the fill animation respects reduced motion.

### Installation

**Command**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-interactive
```

Works in any project with a `components.json`. See [Installation](https://suiss.app/ui/docs/installation#add-components) for the one-line registry setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-interactive
```

**Manual**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Toggle Group](https://suiss.app/ui/docs/components/toggle-group).

2. Copy and paste the following code into your project.

```tsx title="components/charts/radial-chart-interactive.tsx"
"use client"

import * as React from "react"

import { Card, CardContent, CardHeader } from "@/components/ui/card"
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"

type Ring = "move" | "exercise" | "stand"

const RINGS: {
  key: Ring
  label: string
  unit: string
  goal: number
  color: string
}[] = [
  {
    key: "move",
    label: "Move",
    unit: "kcal",
    goal: 600,
    color: "var(--color-red-500)",
  },
  {
    key: "exercise",
    label: "Exercise",
    unit: "min",
    goal: 30,
    color: "var(--color-green-500)",
  },
  {
    key: "stand",
    label: "Stand",
    unit: "hr",
    goal: 12,
    color: "var(--color-cyan-500)",
  },
]

const WEEK = [
  { day: "Monday", values: [520, 34, 11] },
  { day: "Tuesday", values: [610, 42, 12] },
  { day: "Wednesday", values: [380, 18, 9] },
  { day: "Thursday", values: [640, 45, 12] },
  { day: "Friday", values: [470, 28, 10] },
  { day: "Saturday", values: [720, 62, 12] },
  { day: "Sunday", values: [486, 24, 10] },
]

const FILL_DURATION = 750

const NO_ACTIVITY = RINGS.map(() => 0)

function useMorph(target: number[]) {
  const [values, setValues] = React.useState(() => target.map(() => 0))
  const valuesRef = React.useRef(values)

  React.useEffect(() => {
    const from = valuesRef.current
    const reduced = window.matchMedia(
      "(prefers-reduced-motion: reduce)"
    ).matches
    const start = performance.now()
    let frame = 0
    const step = () => {
      const progress = reduced
        ? 1
        : Math.min(1, (performance.now() - start) / FILL_DURATION)
      const eased =
        progress < 0.5 ? 4 * progress ** 3 : 1 - (-2 * progress + 2) ** 3 / 2
      const next =
        progress < 1
          ? target.map((value, index) => {
              const origin = from[index] ?? value
              return origin + (value - origin) * eased
            })
          : target
      valuesRef.current = next
      setValues(next)
      if (progress < 1) frame = requestAnimationFrame(step)
    }
    frame = requestAnimationFrame(step)
    return () => cancelAnimationFrame(frame)
  }, [target])

  return values
}

function Rings({
  values,
  size,
  bar,
  className,
}: {
  values: number[]
  size: number
  bar: number
  className?: string
}) {
  return (
    <svg
      aria-hidden
      viewBox={`0 0 ${size} ${size}`}
      className={className}
      style={{ rotate: "-90deg" }}
    >
      {RINGS.map((ring, index) => {
        const radius =
          size / 2 - bar / 2 - index * (bar + Math.max(1, bar * 0.12))
        const circumference = 2 * Math.PI * radius
        const progress = Math.max(
          0,
          Math.min(1, (values[index] ?? 0) / ring.goal)
        )
        return (
          <g key={ring.key}>
            <circle
              cx={size / 2}
              cy={size / 2}
              r={radius}
              fill="none"
              strokeWidth={bar}
              stroke={`color-mix(in oklab, ${ring.color} 22%, transparent)`}
            />
            {progress > 0.001 && (
              <circle
                cx={size / 2}
                cy={size / 2}
                r={radius}
                fill="none"
                strokeWidth={bar}
                strokeLinecap="round"
                stroke={ring.color}
                strokeDasharray={`${progress * circumference} ${circumference}`}
              />
            )}
          </g>
        )
      })}
    </svg>
  )
}

export function RadialChartInteractive() {
  const [selected, setSelected] = React.useState(6)
  const target = WEEK[selected]?.values ?? NO_ACTIVITY
  const values = useMorph(target)

  return (
    <Card variant="filled" size="sm" className="[--card-spacing:--spacing(5)]">
      <CardHeader className="gap-0.5">
        <p className="text-lg font-semibold">Activity</p>
        <p className="text-sm text-muted-foreground">This week · pick a day</p>
      </CardHeader>
      <CardContent className="flex flex-col gap-6">
        <ToggleGroup
          spacing={1}
          value={[String(selected)]}
          onValueChange={(value: string[]) => {
            if (value[0] !== undefined) setSelected(Number(value[0]))
          }}
          aria-label="Day"
          className="grid w-full grid-cols-7"
        >
          {WEEK.map((entry, index) => (
            <ToggleGroupItem
              key={entry.day}
              value={String(index)}
              aria-label={entry.day}
              className="h-auto flex-col gap-1.5 rounded-xl px-0 py-2 text-xs font-semibold text-muted-foreground aria-pressed:bg-background aria-pressed:text-foreground aria-pressed:hover:bg-background aria-pressed:hover:text-foreground"
            >
              {entry.day.slice(0, 3)}
              <Rings
                values={entry.values}
                size={40}
                bar={4}
                className="size-10"
              />
            </ToggleGroupItem>
          ))}
        </ToggleGroup>
        <div className="flex flex-wrap items-center justify-center gap-8">
          <Rings
            values={values}
            size={260}
            bar={24}
            className="size-65 max-w-full"
          />
          <p className="sr-only" aria-live="polite">
            {WEEK[selected]?.day}:{" "}
            {RINGS.map(
              (ring, index) =>
                `${ring.label} ${target[index] ?? 0} of ${ring.goal} ${ring.unit}`
            ).join(", ")}
          </p>
          <dl className="flex min-w-44 flex-col gap-4">
            {RINGS.map((ring, index) => {
              const percent = Math.round(
                ((target[index] ?? 0) / ring.goal) * 100
              )
              return (
                <div key={ring.key} className="flex flex-col gap-0.5">
                  <dt className="text-base font-semibold">{ring.label}</dt>
                  <dd
                    className="flex items-baseline gap-0.5 text-[color-mix(in_oklab,var(--ring),var(--foreground)_45%)] dark:text-(--ring)"
                    style={{ "--ring": ring.color } as React.CSSProperties}
                  >
                    <span className="text-3xl font-semibold tracking-tight tabular-nums">
                      {Math.round(values[index] ?? 0)}/{ring.goal}
                    </span>
                    <span className="text-base font-semibold uppercase">
                      {ring.unit}
                    </span>
                  </dd>
                  <dd className="text-xs text-muted-foreground">
                    {percent}%{percent >= 100 ? " · goal met" : ""}
                  </dd>
                </div>
              )
            })}
          </dl>
        </div>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

### Usage

```tsx
import { RadialChartInteractive } from "@/components/charts/radial-chart-interactive"
```

```tsx
<RadialChartInteractive />
```

**React Native, SwiftUI, Jetpack Compose**

```tsx title="uniwind/components/charts/radial-chart-interactive.tsx"
import { cn } from "cn"
import * as React from "react"
import { View } from "react-native"
import Svg, { Circle, G } from "react-native-svg"
import { Card, CardContent, CardHeader } from "@/components/ui/card"
import { type ChartColor, ChartPalette } from "@/components/ui/chart"
import { Text } from "@/components/ui/text"
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"

type Ring = "move" | "exercise" | "stand"

const RINGS: {
  key: Ring
  label: string
  unit: string
  goal: number
  color: ChartColor
  text: string
}[] = [
  {
    key: "move",
    label: "Move",
    unit: "kcal",
    goal: 600,
    color: "red-500",
    text: "text-red-500",
  },
  {
    key: "exercise",
    label: "Exercise",
    unit: "min",
    goal: 30,
    color: "green-500",
    text: "text-green-500",
  },
  {
    key: "stand",
    label: "Stand",
    unit: "hr",
    goal: 12,
    color: "cyan-500",
    text: "text-cyan-500",
  },
]

const WEEK = [
  { day: "Monday", values: [520, 34, 11] },
  { day: "Tuesday", values: [610, 42, 12] },
  { day: "Wednesday", values: [380, 18, 9] },
  { day: "Thursday", values: [640, 45, 12] },
  { day: "Friday", values: [470, 28, 10] },
  { day: "Saturday", values: [720, 62, 12] },
  { day: "Sunday", values: [486, 24, 10] },
]

const NO_ACTIVITY = RINGS.map(() => 0)

function Rings({
  values,
  size,
  bar,
}: {
  values: number[]
  size: number
  bar: number
}) {
  return (
    <View
      accessibilityElementsHidden
      importantForAccessibility="no-hide-descendants"
    >
      <ChartPalette colors={RINGS.map((ring) => ring.color)}>
        {(palette) => (
          <Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>
            <G rotation={-90} origin={`${size / 2}, ${size / 2}`}>
              {RINGS.map((ring, index) => {
                const radius =
                  size / 2 - bar / 2 - index * (bar + Math.max(1, bar * 0.12))
                const circumference = 2 * Math.PI * radius
                const progress = Math.max(
                  0,
                  Math.min(1, (values[index] ?? 0) / ring.goal)
                )
                const color = palette[ring.color]
                return (
                  <G key={ring.key}>
                    <Circle
                      cx={size / 2}
                      cy={size / 2}
                      r={radius}
                      fill="none"
                      strokeWidth={bar}
                      stroke={color}
                      strokeOpacity={0.22}
                    />
                    {progress > 0.001 ? (
                      <Circle
                        cx={size / 2}
                        cy={size / 2}
                        r={radius}
                        fill="none"
                        strokeWidth={bar}
                        strokeLinecap="round"
                        stroke={color}
                        strokeDasharray={`${progress * circumference} ${circumference}`}
                      />
                    ) : null}
                  </G>
                )
              })}
            </G>
          </Svg>
        )}
      </ChartPalette>
    </View>
  )
}

export function RadialChartInteractive() {
  const [selected, setSelected] = React.useState(6)
  const values = WEEK[selected]?.values ?? NO_ACTIVITY

  return (
    <Card variant="filled" size="sm">
      <CardHeader className="gap-0.5">
        <Text className="text-lg font-semibold">Activity</Text>
        <Text className="text-sm text-muted-foreground">
          This week · pick a day
        </Text>
      </CardHeader>
      <CardContent className="gap-6">
        <ToggleGroup
          spacing={1}
          value={[String(selected)]}
          onValueChange={(value) => {
            if (value[0] !== undefined) setSelected(Number(value[0]))
          }}
          accessibilityLabel="Day"
          className="w-full self-stretch"
        >
          {WEEK.map((entry, index) => (
            <ToggleGroupItem
              key={entry.day}
              value={String(index)}
              accessibilityLabel={entry.day}
              className={(state) =>
                cn(
                  "h-auto min-w-0 flex-1 shrink flex-col gap-1.5 rounded-xl px-0 py-2",
                  state.pressed && "bg-background active:opacity-80"
                )
              }
            >
              <Text
                className={cn(
                  "text-xs font-semibold",
                  selected === index
                    ? "text-foreground"
                    : "text-muted-foreground"
                )}
              >
                {entry.day.slice(0, 3)}
              </Text>
              <Rings values={entry.values} size={40} bar={4} />
            </ToggleGroupItem>
          ))}
        </ToggleGroup>
        <View className="flex-row flex-wrap items-center justify-center gap-8">
          <Rings values={values} size={260} bar={24} />
          <View className="min-w-44 gap-4" accessibilityLiveRegion="polite">
            {RINGS.map((ring, index) => {
              const percent = Math.round(
                ((values[index] ?? 0) / ring.goal) * 100
              )
              return (
                <View key={ring.key} accessible className="gap-0.5">
                  <Text className="text-base font-semibold">{ring.label}</Text>
                  <View className="flex-row items-baseline gap-0.5">
                    <Text
                      className={cn(
                        "text-3xl font-semibold tracking-tight tabular-nums",
                        ring.text
                      )}
                    >
                      {`${Math.round(values[index] ?? 0)}/${ring.goal}`}
                    </Text>
                    <Text
                      className={cn(
                        "text-base font-semibold uppercase",
                        ring.text
                      )}
                    >
                      {ring.unit}
                    </Text>
                  </View>
                  <Text className="text-xs text-muted-foreground">
                    {`${percent}%${percent >= 100 ? " · goal met" : ""}`}
                  </Text>
                </View>
              )
            })}
          </View>
        </View>
      </CardContent>
    </Card>
  )
}
```

```swift title="swift/Charts/RadialChartInteractive.swift"
import SwiftUI

private let rings: [(key: String, label: String, unit: String, goal: Double, color: Color)] = [
  ("move", "Move", "kcal", 600, Palette.red500),
  ("exercise", "Exercise", "min", 30, Palette.green500),
  ("stand", "Stand", "hr", 12, Palette.cyan500),
]

private let week: [(day: String, values: [Double])] = [
  ("Monday", [520, 34, 11]),
  ("Tuesday", [610, 42, 12]),
  ("Wednesday", [380, 18, 9]),
  ("Thursday", [640, 45, 12]),
  ("Friday", [470, 28, 10]),
  ("Saturday", [720, 62, 12]),
  ("Sunday", [486, 24, 10]),
]

private struct Rings: View {
  let values: [Double]
  let size: CGFloat
  let bar: CGFloat

  var body: some View {
    ZStack {
      ForEach(rings.indices, id: \.self) { index in
        let ring = rings[index]
        let radius = size / 2 - bar / 2 - CGFloat(index) * (bar + max(1, bar * 0.12))
        let progress = max(0, min(1, (values[index]) / ring.goal))
        Circle()
          .stroke(ring.color.opacity(0.22), lineWidth: bar)
          .frame(width: radius * 2, height: radius * 2)
        Circle()
          .trim(from: 0, to: progress)
          .stroke(ring.color, style: StrokeStyle(lineWidth: bar, lineCap: .round))
          .rotationEffect(.degrees(-90))
          .frame(width: radius * 2, height: radius * 2)
          .opacity(progress > 0.001 ? 1 : 0)
      }
    }
    .frame(width: size, height: size)
    .accessibilityHidden(true)
  }
}

public struct RadialChartInteractive: View {
  @State private var selected = 6
  @State private var values: [Double] = [0, 0, 0]
  @Environment(\.colorScheme) private var colorScheme
  @Environment(\.accessibilityReduceMotion) private var reduceMotion

  public init() {}

  init(selected: Int, filled: Bool) {
    _selected = State(initialValue: selected)
    _values = State(initialValue: filled ? week[selected].values : [0, 0, 0])
  }

  public var body: some View {
    let target = week[selected].values
    Card(.filled, size: .sm) {
      VStack(alignment: .leading, spacing: 2) {
        Text("Activity")
          .textStyle(.lg, weight: .semibold)
        Text("This week · pick a day")
          .textStyle(.sm)
          .foregroundStyle(EsuissColor.mutedForeground)
      }
      .padding(.horizontal, 16)
      CardContent {
        VStack(spacing: 24) {
          HStack(spacing: 4) {
            ForEach(week.indices, id: \.self) { index in
              day(index)
            }
          }
          .hapticFeedback(.selection, trigger: selected)
          .accessibilityElement(children: .contain)
          .accessibilityLabel("Day")
          ViewThatFits(in: .horizontal) {
            HStack(spacing: 32) {
              Rings(values: values, size: 260, bar: 24)
              stats(target)
            }
            VStack(spacing: 24) {
              Rings(values: values, size: 260, bar: 24)
              stats(target)
            }
          }
          .frame(maxWidth: .infinity)
        }
      }
    }
    .onAppear { fill(target) }
    .onChange(of: selected) { _, _ in fill(week[selected].values) }
  }

  private func fill(_ target: [Double]) {
    guard values != target else { return }
    withAnimation(reduceMotion ? nil : .timingCurve(0.65, 0, 0.35, 1, duration: 0.75)) {
      values = target
    }
  }

  private func day(_ index: Int) -> some View {
    let active = index == selected
    return Button {
      selected = index
    } label: {
      VStack(spacing: 6) {
        Text(verbatim: String(week[index].day.prefix(3)))
          .textStyle(.xs, weight: .semibold)
          .foregroundStyle(active ? EsuissColor.foreground : EsuissColor.mutedForeground)
        Rings(values: week[index].values, size: 40, bar: 4)
      }
      .padding(.vertical, 8)
      .frame(maxWidth: .infinity)
      .background(active ? EsuissColor.background : .clear, in: RoundedRectangle(cornerRadius: Radius.xl, style: .continuous))
      .contentShape(RoundedRectangle(cornerRadius: Radius.xl, style: .continuous))
    }
    .buttonStyle(.plain)
    .accessibilityLabel(Text(LocalizedStringKey(week[index].day)))
    .accessibilityAddTraits(active ? .isSelected : [])
  }

  private func stats(_ target: [Double]) -> some View {
    VStack(alignment: .leading, spacing: 16) {
      ForEach(rings.indices, id: \.self) { index in
        let ring = rings[index]
        let percent = Int((target[index] / ring.goal * 100).rounded())
        VStack(alignment: .leading, spacing: 2) {
          Text(LocalizedStringKey(ring.label))
            .textStyle(.base, weight: .semibold)
          HStack(alignment: .firstTextBaseline, spacing: 2) {
            Text(verbatim: "\(Int(target[index]))/\(Int(ring.goal))")
              .textStyle(.xl3, weight: .semibold)
              .monospacedDigit()
              .contentTransition(.numericText(value: target[index]))
            Text(LocalizedStringKey(ring.unit.uppercased()))
              .textStyle(.base, weight: .semibold)
          }
          .foregroundStyle(tint(ring.color))
          Text(verbatim: "\(percent)%\(percent >= 100 ? " · goal met" : "")")
            .textStyle(.xs)
            .foregroundStyle(EsuissColor.mutedForeground)
        }
        .accessibilityElement(children: .combine)
      }
    }
    .frame(minWidth: 176, alignment: .leading)
    .animation(reduceMotion ? nil : .default, value: selected)
  }

  private func tint(_ color: Color) -> Color {
    guard colorScheme != .dark else { return color }
    if #available(iOS 18, *) {
      return color.mix(with: EsuissColor.foreground, by: 0.45)
    }
    return color
  }
}
```

```kt title="kotlin/charts/RadialChartInteractive.kt"
package com.esuiss.ui.charts

import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.CubicBezierEasing
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.selection.selectable
import androidx.compose.foundation.selection.selectableGroup
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.BasicText
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.lerp
import androidx.compose.ui.semantics.LiveRegionMode
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.liveRegion
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Card
import com.esuiss.ui.components.CardContent
import com.esuiss.ui.components.CardSize
import com.esuiss.ui.components.CardVariant
import com.esuiss.ui.components.formReducedMotion
import com.esuiss.ui.components.rememberHaptics
import com.esuiss.ui.theme.Colors
import com.esuiss.ui.theme.EsuissTheme
import com.esuiss.ui.theme.Palette
import com.esuiss.ui.theme.Radius
import com.esuiss.ui.theme.Typography
import kotlin.math.roundToInt
import kotlinx.coroutines.launch

private class RadialInteractiveActivityRing(val label: String, val unit: String, val goal: Double, val color: Colors.() -> Color)

private val activityRings = listOf(
    RadialInteractiveActivityRing("Move", "kcal", 600.0) { Palette.red500 },
    RadialInteractiveActivityRing("Exercise", "min", 30.0) { Palette.green500 },
    RadialInteractiveActivityRing("Stand", "hr", 12.0) { Palette.cyan500 },
)

private class RadialInteractiveActivityDay(val day: String, val values: List<Double>)

private val week = listOf(
    RadialInteractiveActivityDay("Monday", listOf(520.0, 34.0, 11.0)),
    RadialInteractiveActivityDay("Tuesday", listOf(610.0, 42.0, 12.0)),
    RadialInteractiveActivityDay("Wednesday", listOf(380.0, 18.0, 9.0)),
    RadialInteractiveActivityDay("Thursday", listOf(640.0, 45.0, 12.0)),
    RadialInteractiveActivityDay("Friday", listOf(470.0, 28.0, 10.0)),
    RadialInteractiveActivityDay("Saturday", listOf(720.0, 62.0, 12.0)),
    RadialInteractiveActivityDay("Sunday", listOf(486.0, 24.0, 10.0)),
)

private val FillEasing = CubicBezierEasing(0.65f, 0f, 0.35f, 1f)

@Composable
private fun Rings(values: List<Double>, size: Int, bar: Int, modifier: Modifier = Modifier) {
    val colors = EsuissTheme.colors
    RingsCanvas(
        values = activityRings.mapIndexed { index, ring -> (values[index] / ring.goal).toFloat() },
        colors = activityRings.map { it.color(colors) },
        size = size.dp,
        bar = bar.dp,
        gap = maxOf(1f, bar * 0.12f).dp,
        modifier = modifier.clearAndSetSemantics {},
    )
}

@Composable
fun RadialChartInteractive(modifier: Modifier = Modifier) {
    val colors = EsuissTheme.colors
    val reduced = formReducedMotion()
    val haptics = rememberHaptics()
    var selected by remember { mutableIntStateOf(6) }
    val target = week[selected].values
    val animated = remember { activityRings.map { Animatable(0f) } }
    LaunchedEffect(selected) {
        animated.forEachIndexed { index, value ->
            launch {
                if (reduced) value.snapTo(target[index].toFloat()) else value.animateTo(target[index].toFloat(), tween(750, easing = FillEasing))
            }
        }
    }
    val values = animated.map { it.value.toDouble() }
    Card(modifier, variant = CardVariant.Filled, size = CardSize.Sm) {
        CardContent {
            Column(verticalArrangement = Arrangement.spacedBy(2.dp)) {
                BasicText("Activity", style = Typography.lg.copy(color = colors.foreground, fontWeight = FontWeight.SemiBold))
                BasicText("This week · pick a day", style = Typography.sm.copy(color = colors.mutedForeground))
            }
        }
        CardContent(Modifier.padding(top = 20.dp)) {
            Column(verticalArrangement = Arrangement.spacedBy(24.dp)) {
                Row(
                    Modifier
                        .fillMaxWidth()
                        .selectableGroup()
                        .semantics { contentDescription = "Day" },
                    horizontalArrangement = Arrangement.spacedBy(4.dp),
                ) {
                    week.forEachIndexed { index, day ->
                        val active = index == selected
                        val shape = RoundedCornerShape(Radius.xl)
                        Column(
                            Modifier
                                .weight(1f)
                                .clip(shape)
                                .background(if (active) colors.background else Color.Transparent, shape)
                                .selectable(
                                    selected = active,
                                    interactionSource = remember { MutableInteractionSource() },
                                    indication = null,
                                    role = Role.Tab,
                                ) {
                                    if (!active) haptics.selection()
                                    selected = index
                                }
                                .semantics { contentDescription = day.day }
                                .padding(vertical = 8.dp),
                            horizontalAlignment = Alignment.CenterHorizontally,
                            verticalArrangement = Arrangement.spacedBy(6.dp),
                        ) {
                            BasicText(
                                day.day.take(3),
                                Modifier.clearAndSetSemantics {},
                                style = Typography.xs.copy(
                                    color = if (active) colors.foreground else colors.mutedForeground,
                                    fontWeight = FontWeight.SemiBold,
                                ),
                            )
                            Rings(day.values, size = 40, bar = 4)
                        }
                    }
                }
                BoxWithConstraints(Modifier.fillMaxWidth()) {
                    if (maxWidth >= 468.dp) {
                        Row(
                            Modifier.align(Alignment.Center),
                            horizontalArrangement = Arrangement.spacedBy(32.dp),
                            verticalAlignment = Alignment.CenterVertically,
                        ) {
                            Rings(values, size = 260, bar = 24)
                            RingStats(values, target)
                        }
                    } else {
                        Column(
                            Modifier.fillMaxWidth(),
                            horizontalAlignment = Alignment.CenterHorizontally,
                            verticalArrangement = Arrangement.spacedBy(24.dp),
                        ) {
                            Rings(values, size = 260, bar = 24)
                            RingStats(values, target)
                        }
                    }
                }
            }
        }
    }
}

@Composable
private fun RingStats(values: List<Double>, target: List<Double>) {
    val colors = EsuissTheme.colors
    Column(
        Modifier
            .widthIn(min = 176.dp)
            .semantics { liveRegion = LiveRegionMode.Polite },
        verticalArrangement = Arrangement.spacedBy(16.dp),
    ) {
        activityRings.forEachIndexed { index, ring ->
            val percent = (target[index] / ring.goal * 100).roundToInt()
            val color = ring.color(colors)
            val tint = if (colors.isDark) color else lerp(color, colors.foreground, 0.45f)
            Column(Modifier.semantics(mergeDescendants = true) {}, verticalArrangement = Arrangement.spacedBy(2.dp)) {
                BasicText(ring.label, style = Typography.base.copy(color = colors.foreground, fontWeight = FontWeight.SemiBold))
                Row(horizontalArrangement = Arrangement.spacedBy(2.dp)) {
                    BasicText(
                        "${values[index].roundToInt()}/${ring.goal.roundToInt()}",
                        Modifier.alignByBaseline(),
                        style = Typography.xl3.copy(color = tint, fontWeight = FontWeight.SemiBold, fontFeatureSettings = "tnum"),
                    )
                    BasicText(
                        ring.unit.uppercase(),
                        Modifier.alignByBaseline(),
                        style = Typography.base.copy(color = tint, fontWeight = FontWeight.SemiBold),
                    )
                }
                BasicText(
                    "$percent%${if (percent >= 100) " · goal met" else ""}",
                    style = Typography.xs.copy(color = colors.mutedForeground),
                )
            }
        }
    }
}
```

**React Native**

A `Card` with a `ToggleGroup` of seven days, each showing small rings, above a large ring view and per-ring totals. The rings are drawn with `Svg` circles colored through `ChartPalette`; `RINGS` sets each label, unit, goal and color, and `WEEK` holds three values per day. Picking a day updates the large rings and the totals, which show the value, goal and percentage, with a note when a goal is met.

Replace `WEEK` with your daily values and adjust the goals, units and colors in `RINGS`. The component takes no props.

**React Native, SwiftUI, Jetpack Compose**

### Installation

**Command**

**React Native**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-interactive
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-interactive
```

**SwiftUI**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-interactive
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-interactive --platform swift
```

**Jetpack Compose**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-interactive
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-interactive --platform kotlin
```

**React Native**

The CLI also adds what it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text), [Toggle Group](https://suiss.app/ui/docs/components/toggle-group).

**React Native, SwiftUI, Jetpack Compose**

**Manual**

**React Native**

**Uniwind**

1. Install the following dependencies:

```bash title="Terminal"
npx expo install cn react-native-svg
```

2. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text), [Toggle Group](https://suiss.app/ui/docs/components/toggle-group).

3. Copy and paste the following code into `components/charts/radial-chart-interactive.tsx`:

- `uniwind/components/charts/radial-chart-interactive.tsx`: shown above

4. Update the import paths to match your project setup.

**NativeWind**

1. Install the following dependencies:

```bash title="Terminal"
npx expo install cn react-native-svg
```

2. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text), [Toggle Group](https://suiss.app/ui/docs/components/toggle-group).

3. Copy and paste the following code into `components/charts/radial-chart-interactive.tsx`:

```tsx title="nativewind/components/charts/radial-chart-interactive.tsx"
import { cn } from "cn"
import * as React from "react"
import { View } from "react-native"
import Svg, { Circle, G } from "react-native-svg"
import { Card, CardContent, CardHeader } from "@/components/ui/card"
import { type ChartColor, ChartPalette } from "@/components/ui/chart"
import { Text } from "@/components/ui/text"
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"

type Ring = "move" | "exercise" | "stand"

const RINGS: {
  key: Ring
  label: string
  unit: string
  goal: number
  color: ChartColor
  text: string
}[] = [
  {
    key: "move",
    label: "Move",
    unit: "kcal",
    goal: 600,
    color: "red-500",
    text: "text-red-500",
  },
  {
    key: "exercise",
    label: "Exercise",
    unit: "min",
    goal: 30,
    color: "green-500",
    text: "text-green-500",
  },
  {
    key: "stand",
    label: "Stand",
    unit: "hr",
    goal: 12,
    color: "cyan-500",
    text: "text-cyan-500",
  },
]

const WEEK = [
  { day: "Monday", values: [520, 34, 11] },
  { day: "Tuesday", values: [610, 42, 12] },
  { day: "Wednesday", values: [380, 18, 9] },
  { day: "Thursday", values: [640, 45, 12] },
  { day: "Friday", values: [470, 28, 10] },
  { day: "Saturday", values: [720, 62, 12] },
  { day: "Sunday", values: [486, 24, 10] },
]

const NO_ACTIVITY = RINGS.map(() => 0)

function Rings({
  values,
  size,
  bar,
}: {
  values: number[]
  size: number
  bar: number
}) {
  return (
    <View
      accessibilityElementsHidden
      importantForAccessibility="no-hide-descendants"
    >
      <ChartPalette colors={RINGS.map((ring) => ring.color)}>
        {(palette) => (
          <Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>
            <G rotation={-90} origin={`${size / 2}, ${size / 2}`}>
              {RINGS.map((ring, index) => {
                const radius =
                  size / 2 - bar / 2 - index * (bar + Math.max(1, bar * 0.12))
                const circumference = 2 * Math.PI * radius
                const progress = Math.max(
                  0,
                  Math.min(1, (values[index] ?? 0) / ring.goal)
                )
                const color = palette[ring.color]
                return (
                  <G key={ring.key}>
                    <Circle
                      cx={size / 2}
                      cy={size / 2}
                      r={radius}
                      fill="none"
                      strokeWidth={bar}
                      stroke={color}
                      strokeOpacity={0.22}
                    />
                    {progress > 0.001 ? (
                      <Circle
                        cx={size / 2}
                        cy={size / 2}
                        r={radius}
                        fill="none"
                        strokeWidth={bar}
                        strokeLinecap="round"
                        stroke={color}
                        strokeDasharray={`${progress * circumference} ${circumference}`}
                      />
                    ) : null}
                  </G>
                )
              })}
            </G>
          </Svg>
        )}
      </ChartPalette>
    </View>
  )
}

export function RadialChartInteractive() {
  const [selected, setSelected] = React.useState(6)
  const values = WEEK[selected]?.values ?? NO_ACTIVITY

  return (
    <Card variant="filled" size="sm">
      <CardHeader className="gap-0.5">
        <Text className="text-lg font-semibold">Activity</Text>
        <Text className="text-sm text-muted-foreground">
          This week · pick a day
        </Text>
      </CardHeader>
      <CardContent className="gap-6">
        <ToggleGroup
          spacing={1}
          value={[String(selected)]}
          onValueChange={(value) => {
            if (value[0] !== undefined) setSelected(Number(value[0]))
          }}
          accessibilityLabel="Day"
          className="w-full self-stretch"
        >
          {WEEK.map((entry, index) => (
            <ToggleGroupItem
              key={entry.day}
              value={String(index)}
              accessibilityLabel={entry.day}
              className={(state) =>
                cn(
                  "h-auto min-w-0 flex-1 shrink flex-col gap-1.5 rounded-xl px-0 py-2",
                  state.pressed && "bg-background active:opacity-80"
                )
              }
            >
              <Text
                className={cn(
                  "text-xs font-semibold",
                  selected === index
                    ? "text-foreground"
                    : "text-muted-foreground"
                )}
              >
                {entry.day.slice(0, 3)}
              </Text>
              <Rings values={entry.values} size={40} bar={4} />
            </ToggleGroupItem>
          ))}
        </ToggleGroup>
        <View className="flex-row flex-wrap items-center justify-center gap-8">
          <Rings values={values} size={260} bar={24} />
          <View className="min-w-44 gap-4" accessibilityLiveRegion="polite">
            {RINGS.map((ring, index) => {
              const percent = Math.round(
                ((values[index] ?? 0) / ring.goal) * 100
              )
              return (
                <View key={ring.key} accessible className="gap-0.5">
                  <Text className="text-base font-semibold">{ring.label}</Text>
                  <View className="flex-row items-baseline gap-0.5">
                    <Text
                      className={cn(
                        "text-3xl font-semibold tracking-tight tabular-nums",
                        ring.text
                      )}
                    >
                      {`${Math.round(values[index] ?? 0)}/${ring.goal}`}
                    </Text>
                    <Text
                      className={cn(
                        "text-base font-semibold uppercase",
                        ring.text
                      )}
                    >
                      {ring.unit}
                    </Text>
                  </View>
                  <Text className="text-xs text-muted-foreground">
                    {`${percent}%${percent >= 100 ? " · goal met" : ""}`}
                  </Text>
                </View>
              )
            })}
          </View>
        </View>
      </CardContent>
    </Card>
  )
}
```

4. Update the import paths to match your project setup.

**StyleSheet**

1. Install the following dependencies:

```bash title="Terminal"
npx expo install react-native-svg
```

2. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text), [Toggle Group](https://suiss.app/ui/docs/components/toggle-group).

3. Copy and paste the following code into `components/charts/radial-chart-interactive.tsx`:

```tsx title="stylesheet/components/charts/radial-chart-interactive.tsx"
import * as React from "react"
import { StyleSheet, View } from "react-native"
import Svg, { Circle, G } from "react-native-svg"
import { Card, CardContent, CardHeader } from "@/components/ui/card"
import { type ChartColor, ChartPalette } from "@/components/ui/chart"
import { Text } from "@/components/ui/text"
import {
  fontSize,
  palette,
  type ThemeColors,
  useTheme,
} from "@/components/ui/theme"

import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"

type Tone = keyof ThemeColors | keyof typeof palette

function tone(colors: ThemeColors, key: Tone) {
  return { ...colors, ...palette }[key]
}

type Ring = "move" | "exercise" | "stand"

const RINGS: {
  key: Ring
  label: string
  unit: string
  goal: number
  color: ChartColor
  swatch: Tone
}[] = [
  {
    key: "move",
    label: "Move",
    unit: "kcal",
    goal: 600,
    color: "red-500",
    swatch: "red500",
  },
  {
    key: "exercise",
    label: "Exercise",
    unit: "min",
    goal: 30,
    color: "green-500",
    swatch: "green500",
  },
  {
    key: "stand",
    label: "Stand",
    unit: "hr",
    goal: 12,
    color: "cyan-500",
    swatch: "cyan500",
  },
]

const WEEK = [
  { day: "Monday", values: [520, 34, 11] },
  { day: "Tuesday", values: [610, 42, 12] },
  { day: "Wednesday", values: [380, 18, 9] },
  { day: "Thursday", values: [640, 45, 12] },
  { day: "Friday", values: [470, 28, 10] },
  { day: "Saturday", values: [720, 62, 12] },
  { day: "Sunday", values: [486, 24, 10] },
]

const NO_ACTIVITY = RINGS.map(() => 0)

const styles = StyleSheet.create({
  header: { gap: 2 },
  title: { ...fontSize.lg, fontWeight: "600" },
  caption: { ...fontSize.sm },
  content: { gap: 24 },
  days: { width: "100%", alignSelf: "stretch" },
  day: {
    height: "auto",
    minWidth: 0,
    flex: 1,
    flexShrink: 1,
    flexDirection: "column",
    gap: 6,
    borderRadius: 12,
    paddingHorizontal: 0,
    paddingVertical: 8,
  },
  dayLabel: { ...fontSize.xs, fontWeight: "600" },
  summary: {
    flexDirection: "row",
    flexWrap: "wrap",
    alignItems: "center",
    justifyContent: "center",
    gap: 32,
  },
  rings: { minWidth: 176, gap: 16 },
  ring: { gap: 2 },
  ringLabel: { ...fontSize.base, fontWeight: "600" },
  reading: { flexDirection: "row", alignItems: "baseline", gap: 2 },
  value: {
    ...fontSize["3xl"],
    fontWeight: "600",
    letterSpacing: -0.75,
    fontVariant: ["tabular-nums"],
  },
  unit: { ...fontSize.base, fontWeight: "600", textTransform: "uppercase" },
  percent: { ...fontSize.xs },
})

function Rings({
  values,
  size,
  bar,
}: {
  values: number[]
  size: number
  bar: number
}) {
  return (
    <View
      accessibilityElementsHidden
      importantForAccessibility="no-hide-descendants"
    >
      <ChartPalette colors={RINGS.map((ring) => ring.color)}>
        {(palette) => (
          <Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>
            <G rotation={-90} origin={`${size / 2}, ${size / 2}`}>
              {RINGS.map((ring, index) => {
                const radius =
                  size / 2 - bar / 2 - index * (bar + Math.max(1, bar * 0.12))
                const circumference = 2 * Math.PI * radius
                const progress = Math.max(
                  0,
                  Math.min(1, (values[index] ?? 0) / ring.goal)
                )
                const color = palette[ring.color]
                return (
                  <G key={ring.key}>
                    <Circle
                      cx={size / 2}
                      cy={size / 2}
                      r={radius}
                      fill="none"
                      strokeWidth={bar}
                      stroke={color}
                      strokeOpacity={0.22}
                    />
                    {progress > 0.001 ? (
                      <Circle
                        cx={size / 2}
                        cy={size / 2}
                        r={radius}
                        fill="none"
                        strokeWidth={bar}
                        strokeLinecap="round"
                        stroke={color}
                        strokeDasharray={`${progress * circumference} ${circumference}`}
                      />
                    ) : null}
                  </G>
                )
              })}
            </G>
          </Svg>
        )}
      </ChartPalette>
    </View>
  )
}

export function RadialChartInteractive() {
  const { colors } = useTheme()
  const [selected, setSelected] = React.useState(6)
  const values = WEEK[selected]?.values ?? NO_ACTIVITY

  return (
    <Card variant="filled" size="sm">
      <CardHeader style={styles.header}>
        <Text style={styles.title}>Activity</Text>
        <Text style={[styles.caption, { color: colors.mutedForeground }]}>
          This week · pick a day
        </Text>
      </CardHeader>
      <CardContent style={styles.content}>
        <ToggleGroup
          spacing={1}
          value={[String(selected)]}
          onValueChange={(value) => {
            if (value[0] !== undefined) setSelected(Number(value[0]))
          }}
          accessibilityLabel="Day"
          style={styles.days}
        >
          {WEEK.map((entry, index) => (
            <ToggleGroupItem
              key={entry.day}
              value={String(index)}
              accessibilityLabel={entry.day}
              style={(state) => [
                styles.day,
                state.pressed && { backgroundColor: colors.background },
              ]}
            >
              <Text
                style={[
                  styles.dayLabel,
                  {
                    color:
                      selected === index
                        ? colors.foreground
                        : colors.mutedForeground,
                  },
                ]}
              >
                {entry.day.slice(0, 3)}
              </Text>
              <Rings values={entry.values} size={40} bar={4} />
            </ToggleGroupItem>
          ))}
        </ToggleGroup>
        <View style={styles.summary}>
          <Rings values={values} size={260} bar={24} />
          <View style={styles.rings} accessibilityLiveRegion="polite">
            {RINGS.map((ring, index) => {
              const percent = Math.round(
                ((values[index] ?? 0) / ring.goal) * 100
              )
              return (
                <View key={ring.key} accessible style={styles.ring}>
                  <Text style={styles.ringLabel}>{ring.label}</Text>
                  <View style={styles.reading}>
                    <Text
                      style={[
                        styles.value,
                        { color: tone(colors, ring.swatch) },
                      ]}
                    >
                      {`${Math.round(values[index] ?? 0)}/${ring.goal}`}
                    </Text>
                    <Text
                      style={[
                        styles.unit,
                        { color: tone(colors, ring.swatch) },
                      ]}
                    >
                      {ring.unit}
                    </Text>
                  </View>
                  <Text
                    style={[styles.percent, { color: colors.mutedForeground }]}
                  >
                    {`${percent}%${percent >= 100 ? " · goal met" : ""}`}
                  </Text>
                </View>
              )
            })}
          </View>
        </View>
      </CardContent>
    </Card>
  )
}
```

4. Update the import paths to match your project setup.

**SwiftUI**

1. Target iOS 17 or later.

2. Copy the theme files every view uses:

- `swift/Theme/Theme.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Theme.swift)

- `swift/Theme/Tokens.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Tokens.swift)

3. Copy the source and every file it uses:

- `swift/Charts/RadialChartInteractive.swift`: shown above

- `swift/Components/Card.swift`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `swift/Components/Haptics.swift`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

4. Add the files to your app target.

**Jetpack Compose**

1. Apply the Compose compiler plugin, enable Compose, set `compileSdk` to 37 or higher and `minSdk` to 24 or higher, and add the dependencies:

```kotlin title="build.gradle.kts"
plugins {
    id("org.jetbrains.kotlin.plugin.compose")
}

android {
    compileSdk = 37
    defaultConfig { minSdk = 24 }
    buildFeatures { compose = true }
}

dependencies {
    implementation(platform("androidx.compose:compose-bom:2026.09.00"))
    implementation("androidx.compose.foundation:foundation")
    implementation("androidx.compose.ui:ui")
}
```

2. Copy the theme files every view uses:

- `kotlin/theme/Theme.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Theme.kt)

- `kotlin/theme/Tokens.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Tokens.kt)

3. Copy the source and every file it uses:

- `kotlin/charts/RadialChartInteractive.kt`: shown above

- `kotlin/charts/RadialChartRings.kt`: see [Radial Chart](https://suiss.app/ui/docs/charts/radial-chart.md)

- `kotlin/components/Card.kt`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `kotlin/components/Content.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/Content.kt)

- `kotlin/components/FormSupport.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/FormSupport.kt)

- `kotlin/components/Haptics.kt`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

4. Update the `com.esuiss.ui` package names to match your project.

**React Native, SwiftUI, Jetpack Compose**

### Usage

**React Native**

```tsx
import { RadialChartInteractive } from "@/components/charts/radial-chart-interactive"
```

```tsx
<RadialChartInteractive />
```

**SwiftUI**

```swift
import SwiftUI

struct RadialInteractiveExample: View {
  var body: some View {
    RadialChartInteractive()
  }
}
```

**Jetpack Compose**

```kotlin
import androidx.compose.runtime.Composable
import com.esuiss.ui.charts.RadialChartInteractive

@Composable
fun RadialInteractiveExample() {
    RadialChartInteractive()
}
```



## Radial Chart Label

Concentric radial bars with each category's name printed at the start of its bar.

Source: https://suiss.app/ui/docs/charts/radial-chart#label

**React**

**Example**

```tsx title="components/charts/radial-chart-label.tsx"
"use client"

import { LabelList, RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
} from "@/components/ui/chart"

const chartData = [
  { device: "phone", users: 275, fill: "var(--color-phone)" },
  { device: "laptop", users: 200, fill: "var(--color-laptop)" },
  { device: "tablet", users: 187, fill: "var(--color-tablet)" },
  { device: "watch", users: 173, fill: "var(--color-watch)" },
]

const chartConfig = {
  users: { label: "Users" },
  phone: { label: "Phone", color: "var(--chart-1)" },
  laptop: { label: "Laptop", color: "var(--chart-2)" },
  tablet: { label: "Tablet", color: "var(--chart-3)" },
  watch: { label: "Watch", color: "var(--chart-4)" },
} satisfies ChartConfig

export function RadialChartLabel() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Labeled</CardTitle>
        <CardDescription>
          Each name sits at the start of its bar
        </CardDescription>
      </CardHeader>
      <CardContent>
        <ChartContainer
          config={chartConfig}
          className="aspect-auto h-52 w-full"
        >
          <RadialBarChart
            accessibilityLayer
            data={chartData}
            innerRadius="28%"
            outerRadius="100%"
            barSize={16}
            startAngle={90}
            endAngle={-200}
          >
            <ChartTooltip
              cursor={false}
              content={<ChartTooltipContent hideLabel nameKey="device" />}
            />
            <RadialBar
              dataKey="users"
              cornerRadius={10}
              background={{ fill: "var(--secondary)" }}
            >
              <LabelList
                dataKey="device"
                position="insideStart"
                className="fill-primary-foreground text-xs font-semibold"
                formatter={(value) =>
                  chartConfig[String(value) as keyof typeof chartConfig]?.label
                }
              />
            </RadialBar>
          </RadialBarChart>
        </ChartContainer>
      </CardContent>
    </Card>
  )
}
```

Concentric radial bars with each category name printed at the start of its bar. Pick it over the default radial chart when you want readers to identify bars without a legend or tooltip.

Replace `chartData` and add each category key with its label and color to `chartConfig`; the bar labels read from there. `startAngle` and `endAngle` set how far the longest bar sweeps, and `barSize` makes room for longer names. Labels sit inside the bars, so very short bars may not fit their name.

### Installation

**Command**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-label
```

Works in any project with a `components.json`. See [Installation](https://suiss.app/ui/docs/installation#add-components) for the one-line registry setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-label
```

**Manual**

1. Install the following dependencies:

```bash title="Terminal"
npm install recharts
```

2. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

3. Copy and paste the following code into your project.

```tsx title="components/charts/radial-chart-label.tsx"
"use client"

import { LabelList, RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
} from "@/components/ui/chart"

const chartData = [
  { device: "phone", users: 275, fill: "var(--color-phone)" },
  { device: "laptop", users: 200, fill: "var(--color-laptop)" },
  { device: "tablet", users: 187, fill: "var(--color-tablet)" },
  { device: "watch", users: 173, fill: "var(--color-watch)" },
]

const chartConfig = {
  users: { label: "Users" },
  phone: { label: "Phone", color: "var(--chart-1)" },
  laptop: { label: "Laptop", color: "var(--chart-2)" },
  tablet: { label: "Tablet", color: "var(--chart-3)" },
  watch: { label: "Watch", color: "var(--chart-4)" },
} satisfies ChartConfig

export function RadialChartLabel() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Labeled</CardTitle>
        <CardDescription>
          Each name sits at the start of its bar
        </CardDescription>
      </CardHeader>
      <CardContent>
        <ChartContainer
          config={chartConfig}
          className="aspect-auto h-52 w-full"
        >
          <RadialBarChart
            accessibilityLayer
            data={chartData}
            innerRadius="28%"
            outerRadius="100%"
            barSize={16}
            startAngle={90}
            endAngle={-200}
          >
            <ChartTooltip
              cursor={false}
              content={<ChartTooltipContent hideLabel nameKey="device" />}
            />
            <RadialBar
              dataKey="users"
              cornerRadius={10}
              background={{ fill: "var(--secondary)" }}
            >
              <LabelList
                dataKey="device"
                position="insideStart"
                className="fill-primary-foreground text-xs font-semibold"
                formatter={(value) =>
                  chartConfig[String(value) as keyof typeof chartConfig]?.label
                }
              />
            </RadialBar>
          </RadialBarChart>
        </ChartContainer>
      </CardContent>
    </Card>
  )
}
```

4. Update the import paths to match your project setup.

### Usage

```tsx
import { RadialChartLabel } from "@/components/charts/radial-chart-label"
```

```tsx
<RadialChartLabel />
```

**React Native, SwiftUI, Jetpack Compose**

```tsx title="uniwind/components/charts/radial-chart-label.tsx"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  Cell,
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  LabelList,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"

const chartConfig = {
  users: { label: "Users" },
  phone: { label: "Phone", color: "chart-1" },
  laptop: { label: "Laptop", color: "chart-2" },
  tablet: { label: "Tablet", color: "chart-3" },
  watch: { label: "Watch", color: "chart-4" },
} satisfies ChartConfig

type Device = "phone" | "laptop" | "tablet" | "watch"

const chartData: { device: Device; users: number }[] = [
  { device: "phone", users: 275 },
  { device: "laptop", users: 200 },
  { device: "tablet", users: 187 },
  { device: "watch", users: 173 },
]

export function RadialChartLabel() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Labeled</CardTitle>
        <CardDescription>
          Each name sits at the start of its bar
        </CardDescription>
      </CardHeader>
      <CardContent>
        <ChartContainer
          config={chartConfig}
          accessibilityLabel="Labeled"
          className="h-52 w-full"
        >
          <RadialBarChart
            data={chartData}
            innerRadius="28%"
            outerRadius="100%"
            barSize={16}
            startAngle={90}
            endAngle={-200}
          >
            <ChartTooltip
              cursor={false}
              content={<ChartTooltipContent hideLabel nameKey="device" />}
            />
            <RadialBar
              dataKey="users"
              cornerRadius={10}
              background={{ fill: "secondary" }}
            >
              {chartData.map((item) => (
                <Cell key={item.device} fill={chartConfig[item.device].color} />
              ))}
              <LabelList
                dataKey="device"
                position="insideStart"
                className="text-xs font-semibold text-primary-foreground"
                formatter={(value) => chartConfig[value as Device]?.label}
              />
            </RadialBar>
          </RadialBarChart>
        </ChartContainer>
      </CardContent>
    </Card>
  )
}
```

```swift title="swift/Charts/RadialChartLabel.swift"
import SwiftUI

private let chartData: [(device: String, users: Double)] = [
  ("phone", 275), ("laptop", 200), ("tablet", 187), ("watch", 173),
]

private let chartConfig: ChartConfig = [
  "users": .init("Users"),
  "phone": .init("Phone", color: EsuissColor.chart1),
  "laptop": .init("Laptop", color: EsuissColor.chart2),
  "tablet": .init("Tablet", color: EsuissColor.chart3),
  "watch": .init("Watch", color: EsuissColor.chart4),
]

public struct RadialChartLabel: View {
  @State private var selection: Int?

  public init() {}

  public var body: some View {
    Card(.filled, size: .sm) {
      CardHeader("Labeled", description: "Each name sits at the start of its bar")
      CardContent {
        ChartContainer(config: chartConfig) {
          RadialBarChart(
            chartData.map { RadialBar($0.device, value: $0.users) },
            innerRadius: 0.28,
            outerRadius: 1,
            barSize: 16,
            startAngle: .zero,
            endAngle: .degrees(290),
            rounded: true,
            track: .control,
            showsLabels: true,
            selection: $selection,
            accessibilityLabel: "Labeled"
          ) { payload in
            ChartTooltipContent(payload, hideLabel: true)
          }
        }
        .frame(height: 208)
      }
    }
  }
}
```

```kt title="kotlin/charts/RadialChartLabel.kt"
package com.esuiss.ui.charts

import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Card
import com.esuiss.ui.components.CardContent
import com.esuiss.ui.components.CardHeader
import com.esuiss.ui.components.CardSize
import com.esuiss.ui.components.CardVariant
import com.esuiss.ui.components.ChartConfig
import com.esuiss.ui.components.ChartConfigItem
import com.esuiss.ui.components.ChartContainer
import com.esuiss.ui.components.ChartLabelList
import com.esuiss.ui.components.ChartLabelPosition
import com.esuiss.ui.components.ChartTooltipContent
import com.esuiss.ui.components.RadialBarChart
import com.esuiss.ui.theme.EsuissTheme
import com.esuiss.ui.theme.Typography

private class RadialLabelDeviceUsers(val device: String, val users: Double)

private val chartData = listOf(
    RadialLabelDeviceUsers("phone", 275.0),
    RadialLabelDeviceUsers("laptop", 200.0),
    RadialLabelDeviceUsers("tablet", 187.0),
    RadialLabelDeviceUsers("watch", 173.0),
)

private val chartConfig = ChartConfig(
    "users" to ChartConfigItem("Users"),
    "phone" to ChartConfigItem("Phone") { chart1 },
    "laptop" to ChartConfigItem("Laptop") { chart2 },
    "tablet" to ChartConfigItem("Tablet") { chart3 },
    "watch" to ChartConfigItem("Watch") { chart4 },
)

@Composable
fun RadialChartLabel(modifier: Modifier = Modifier) {
    val colors = EsuissTheme.colors
    Card(modifier, variant = CardVariant.Filled, size = CardSize.Sm) {
        CardHeader("Labeled", description = "Each name sits at the start of its bar")
        CardContent {
            ChartContainer(
                chartConfig,
                Modifier
                    .fillMaxWidth()
                    .height(208.dp),
            ) {
                RadialBarChart(
                    chartData,
                    innerRadius = 0.28f,
                    outerRadius = 1f,
                    barSize = 16.dp,
                    startAngle = 90f,
                    endAngle = -200f,
                    accessibilityLabel = "Labeled",
                ) {
                    ChartTooltip { ChartTooltipContent(hideLabel = true) }
                    RadialBar(
                        "users",
                        value = { it.users },
                        nameKey = { it.device },
                        cornerRadius = 10.dp,
                        background = colors.secondary,
                        labelList = ChartLabelList(
                            ChartLabelPosition.InsideStart,
                            color = colors.primaryForeground,
                            fontSize = Typography.xs.fontSize,
                            formatter = { index, _ -> chartConfig[chartData[index].device]?.label ?: "" },
                        ),
                    )
                }
            }
        }
    }
}
```

**React Native**

A `RadialBarChart` with one bar per record in `chartData`, sweeping from 90 to -200 degrees. Bars are colored through `Cell` and labeled with a `LabelList` that reads names from `chartConfig`. Pressing a bar shows a tooltip.

Replace `chartData` with your records and add a matching entry per item to `chartConfig`, whose colors the `Cell` children read. The component takes no props.

**React Native, SwiftUI, Jetpack Compose**

### Installation

**Command**

**React Native**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-label
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-label
```

**SwiftUI**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-label
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-label --platform swift
```

**Jetpack Compose**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-label
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-label --platform kotlin
```

**React Native**

The CLI also adds what it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

**React Native, SwiftUI, Jetpack Compose**

**Manual**

**React Native**

**Uniwind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

2. Copy and paste the following code into `components/charts/radial-chart-label.tsx`:

- `uniwind/components/charts/radial-chart-label.tsx`: shown above

3. Update the import paths to match your project setup.

**NativeWind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

2. Copy and paste the following code into `components/charts/radial-chart-label.tsx`:

```tsx title="nativewind/components/charts/radial-chart-label.tsx"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  Cell,
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  LabelList,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"

const chartConfig = {
  users: { label: "Users" },
  phone: { label: "Phone", color: "chart-1" },
  laptop: { label: "Laptop", color: "chart-2" },
  tablet: { label: "Tablet", color: "chart-3" },
  watch: { label: "Watch", color: "chart-4" },
} satisfies ChartConfig

type Device = "phone" | "laptop" | "tablet" | "watch"

const chartData: { device: Device; users: number }[] = [
  { device: "phone", users: 275 },
  { device: "laptop", users: 200 },
  { device: "tablet", users: 187 },
  { device: "watch", users: 173 },
]

export function RadialChartLabel() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Labeled</CardTitle>
        <CardDescription>
          Each name sits at the start of its bar
        </CardDescription>
      </CardHeader>
      <CardContent>
        <ChartContainer
          config={chartConfig}
          accessibilityLabel="Labeled"
          className="h-52 w-full"
        >
          <RadialBarChart
            data={chartData}
            innerRadius="28%"
            outerRadius="100%"
            barSize={16}
            startAngle={90}
            endAngle={-200}
          >
            <ChartTooltip
              cursor={false}
              content={<ChartTooltipContent hideLabel nameKey="device" />}
            />
            <RadialBar
              dataKey="users"
              cornerRadius={10}
              background={{ fill: "secondary" }}
            >
              {chartData.map((item) => (
                <Cell key={item.device} fill={chartConfig[item.device].color} />
              ))}
              <LabelList
                dataKey="device"
                position="insideStart"
                className="text-xs font-semibold text-primary-foreground"
                formatter={(value) => chartConfig[value as Device]?.label}
              />
            </RadialBar>
          </RadialBarChart>
        </ChartContainer>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**StyleSheet**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

2. Copy and paste the following code into `components/charts/radial-chart-label.tsx`:

```tsx title="stylesheet/components/charts/radial-chart-label.tsx"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  Cell,
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  LabelList,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { fontSize, useTheme } from "@/components/ui/theme"

const chartConfig = {
  users: { label: "Users" },
  phone: { label: "Phone", color: "chart-1" },
  laptop: { label: "Laptop", color: "chart-2" },
  tablet: { label: "Tablet", color: "chart-3" },
  watch: { label: "Watch", color: "chart-4" },
} satisfies ChartConfig

type Device = "phone" | "laptop" | "tablet" | "watch"

const chartData: { device: Device; users: number }[] = [
  { device: "phone", users: 275 },
  { device: "laptop", users: 200 },
  { device: "tablet", users: 187 },
  { device: "watch", users: 173 },
]

export function RadialChartLabel() {
  const { colors } = useTheme()
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Labeled</CardTitle>
        <CardDescription>
          Each name sits at the start of its bar
        </CardDescription>
      </CardHeader>
      <CardContent>
        <ChartContainer
          config={chartConfig}
          accessibilityLabel="Labeled"
          style={{ height: 208 }}
        >
          <RadialBarChart
            data={chartData}
            innerRadius="28%"
            outerRadius="100%"
            barSize={16}
            startAngle={90}
            endAngle={-200}
          >
            <ChartTooltip
              cursor={false}
              content={<ChartTooltipContent hideLabel nameKey="device" />}
            />
            <RadialBar
              dataKey="users"
              cornerRadius={10}
              background={{ fill: "secondary" }}
            >
              {chartData.map((item) => (
                <Cell key={item.device} fill={chartConfig[item.device].color} />
              ))}
              <LabelList
                dataKey="device"
                position="insideStart"
                style={{
                  ...fontSize.xs,
                  fontWeight: "600",
                  color: colors.primaryForeground,
                }}
                formatter={(value) => chartConfig[value as Device]?.label}
              />
            </RadialBar>
          </RadialBarChart>
        </ChartContainer>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**SwiftUI**

1. Target iOS 17 or later.

2. Add the Swift package to your app:

```swift title="Package.swift"
.package(url: "https://github.com/phosphor-icons/swift", from: "2.1.0")
```

3. Copy the theme files every view uses:

- `swift/Theme/Theme.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Theme.swift)

- `swift/Theme/Tokens.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Tokens.swift)

4. Copy the source and every file it uses:

- `swift/Charts/RadialChartLabel.swift`: shown above

- `swift/Components/Card.swift`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `swift/Components/Chart.swift`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `swift/Components/Checkbox.swift`: see [Checkbox](https://suiss.app/ui/docs/components/checkbox.md)

- `swift/Components/Field.swift`: see [Field](https://suiss.app/ui/docs/components/field.md)

- `swift/Components/Haptics.swift`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `swift/Components/Item.swift`: see [Item](https://suiss.app/ui/docs/components/item.md)

- `swift/Components/Separator.swift`: see [Separator](https://suiss.app/ui/docs/components/separator.md)

5. Add the files to your app target.

**Jetpack Compose**

1. Apply the Compose compiler plugin, enable Compose, set `compileSdk` to 37 or higher and `minSdk` to 24 or higher, and add the dependencies:

```kotlin title="build.gradle.kts"
plugins {
    id("org.jetbrains.kotlin.plugin.compose")
}

android {
    compileSdk = 37
    defaultConfig { minSdk = 24 }
    buildFeatures { compose = true }
}

dependencies {
    implementation(platform("androidx.compose:compose-bom:2026.09.00"))
    implementation("androidx.compose.foundation:foundation")
    implementation("androidx.compose.ui:ui")
}
```

2. Copy the theme files every view uses:

- `kotlin/theme/Theme.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Theme.kt)

- `kotlin/theme/Tokens.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Tokens.kt)

3. Copy the source and every file it uses:

- `kotlin/charts/RadialChartLabel.kt`: shown above

- `kotlin/components/Card.kt`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `kotlin/components/Chart.kt`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `kotlin/components/Content.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/Content.kt)

- `kotlin/components/FormSupport.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/FormSupport.kt)

- `kotlin/components/Haptics.kt`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `kotlin/components/Icon.kt`: see [Icon](https://suiss.app/ui/docs/components/icon.md)

4. Update the `com.esuiss.ui` package names to match your project.

**React Native, SwiftUI, Jetpack Compose**

### Usage

**React Native**

```tsx
import { RadialChartLabel } from "@/components/charts/radial-chart-label"
```

```tsx
<RadialChartLabel />
```

**SwiftUI**

```swift
import SwiftUI

struct RadialLabelExample: View {
  var body: some View {
    RadialChartLabel()
  }
}
```

**Jetpack Compose**

```kotlin
import androidx.compose.runtime.Composable
import com.esuiss.ui.charts.RadialChartLabel

@Composable
fun RadialLabelExample() {
    RadialChartLabel()
}
```



## Radial Chart Progress

A three-quarter arc tracking progress toward a goal, with the count shown in the center.

Source: https://suiss.app/ui/docs/charts/radial-chart#progress

**React**

**Example**

```tsx title="components/charts/radial-chart-progress.tsx"
"use client"

import { PolarAngleAxis, RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import { type ChartConfig, ChartContainer } from "@/components/ui/chart"

const chartData = [{ name: "value", value: 64, fill: "var(--color-value)" }]

const chartConfig = {
  value: { label: "Reading", color: "var(--chart-4)" },
} satisfies ChartConfig

export function RadialChartProgress() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Goal progress</CardTitle>
        <CardDescription>A three-quarter arc</CardDescription>
      </CardHeader>
      <CardContent>
        <div className="relative">
          <ChartContainer
            config={chartConfig}
            className="aspect-auto h-52 w-full"
          >
            <RadialBarChart
              accessibilityLayer={false}
              data={chartData}
              innerRadius="72%"
              outerRadius="100%"
              startAngle={225}
              endAngle={-45}
              barSize={16}
            >
              <PolarAngleAxis
                type="number"
                domain={[0, 100]}
                tick={false}
                axisLine={false}
              />
              <RadialBar
                dataKey="value"
                cornerRadius={20}
                background={{
                  fill: "color-mix(in oklab, var(--color-value) 22%, transparent)",
                }}
              />
            </RadialBarChart>
          </ChartContainer>
          <div className="pointer-events-none absolute inset-0 justify-center flex flex-col items-center text-center">
            <span className="text-3xl font-semibold tracking-tight tabular-nums">
              16 / 25
            </span>
            <span className="text-xs text-muted-foreground">books · 2026</span>
          </div>
        </div>
      </CardContent>
    </Card>
  )
}
```

A three-quarter arc tracking progress toward a goal, with the count shown in the center. Use it for goals with a clear finish line, like a reading challenge or a savings target.

Set the progress as a percentage in `chartData`, or set the `domain` on `PolarAngleAxis` to your goal and pass the raw count. The center text and caption are static, so update them with the value, and set the color in `chartConfig`. There is no tooltip.

### Installation

**Command**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-progress
```

Works in any project with a `components.json`. See [Installation](https://suiss.app/ui/docs/installation#add-components) for the one-line registry setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-progress
```

**Manual**

1. Install the following dependencies:

```bash title="Terminal"
npm install recharts
```

2. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

3. Copy and paste the following code into your project.

```tsx title="components/charts/radial-chart-progress.tsx"
"use client"

import { PolarAngleAxis, RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import { type ChartConfig, ChartContainer } from "@/components/ui/chart"

const chartData = [{ name: "value", value: 64, fill: "var(--color-value)" }]

const chartConfig = {
  value: { label: "Reading", color: "var(--chart-4)" },
} satisfies ChartConfig

export function RadialChartProgress() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Goal progress</CardTitle>
        <CardDescription>A three-quarter arc</CardDescription>
      </CardHeader>
      <CardContent>
        <div className="relative">
          <ChartContainer
            config={chartConfig}
            className="aspect-auto h-52 w-full"
          >
            <RadialBarChart
              accessibilityLayer={false}
              data={chartData}
              innerRadius="72%"
              outerRadius="100%"
              startAngle={225}
              endAngle={-45}
              barSize={16}
            >
              <PolarAngleAxis
                type="number"
                domain={[0, 100]}
                tick={false}
                axisLine={false}
              />
              <RadialBar
                dataKey="value"
                cornerRadius={20}
                background={{
                  fill: "color-mix(in oklab, var(--color-value) 22%, transparent)",
                }}
              />
            </RadialBarChart>
          </ChartContainer>
          <div className="pointer-events-none absolute inset-0 justify-center flex flex-col items-center text-center">
            <span className="text-3xl font-semibold tracking-tight tabular-nums">
              16 / 25
            </span>
            <span className="text-xs text-muted-foreground">books · 2026</span>
          </div>
        </div>
      </CardContent>
    </Card>
  )
}
```

4. Update the import paths to match your project setup.

### Usage

```tsx
import { RadialChartProgress } from "@/components/charts/radial-chart-progress"
```

```tsx
<RadialChartProgress />
```

**React Native, SwiftUI, Jetpack Compose**

```tsx title="uniwind/components/charts/radial-chart-progress.tsx"
import { View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"

const chartData = [{ name: "value", value: 64 }]

const chartConfig = {
  value: { label: "Reading", color: "chart-4" },
} satisfies ChartConfig

export function RadialChartProgress() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Goal progress</CardTitle>
        <CardDescription>A three-quarter arc</CardDescription>
      </CardHeader>
      <CardContent>
        <View>
          <View
            pointerEvents="none"
            className="absolute inset-0 items-center justify-center"
          >
            <Text className="text-3xl font-semibold tracking-tight tabular-nums">
              16 / 25
            </Text>
            <Text className="text-xs text-muted-foreground">books · 2026</Text>
          </View>
          <ChartContainer
            config={chartConfig}
            accessibilityLabel="Goal progress"
            className="h-52 w-full"
          >
            <RadialBarChart
              data={chartData}
              innerRadius="72%"
              outerRadius="100%"
              startAngle={225}
              endAngle={-45}
              barSize={16}
            >
              <PolarAngleAxis domain={[0, 100]} />
              <RadialBar
                dataKey="value"
                cornerRadius={20}
                background={{ fillOpacity: 0.22 }}
              />
            </RadialBarChart>
          </ChartContainer>
        </View>
      </CardContent>
    </Card>
  )
}
```

```swift title="swift/Charts/RadialChartProgress.swift"
import SwiftUI

private let chartConfig: ChartConfig = [
  "value": .init("Reading", color: EsuissColor.chart4),
]

public struct RadialChartProgress: View {
  public init() {}

  public var body: some View {
    Card(.filled, size: .sm) {
      CardHeader("Goal progress", description: "A three-quarter arc")
      CardContent {
        ChartContainer(config: chartConfig) {
          RadialBarChart(
            [RadialBar("value", value: 64)],
            domain: 0...100,
            innerRadius: 0.72,
            outerRadius: 1,
            barSize: 16,
            startAngle: .degrees(-135),
            endAngle: .degrees(135),
            rounded: true,
            track: .tint
          )
          .overlay(alignment: .center) {
            VStack(spacing: 0) {
              Text(verbatim: "16 / 25")
                .textStyle(.xl3, weight: .semibold)
                .monospacedDigit()
              Text("books · 2026")
                .textStyle(.xs)
                .foregroundStyle(EsuissColor.mutedForeground)
            }
            .multilineTextAlignment(.center)
          }
        }
        .frame(height: 208)
        .accessibilityElement(children: .ignore)
        .accessibilityLabel(Text("Goal progress"))
        .accessibilityValue(Text("16 / 25 books · 2026"))
      }
    }
  }
}
```

```kt title="kotlin/charts/RadialChartProgress.kt"
package com.esuiss.ui.charts

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.text.BasicText
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Card
import com.esuiss.ui.components.CardContent
import com.esuiss.ui.components.CardHeader
import com.esuiss.ui.components.CardSize
import com.esuiss.ui.components.CardVariant
import com.esuiss.ui.components.ChartConfig
import com.esuiss.ui.components.ChartConfigItem
import com.esuiss.ui.components.ChartContainer
import com.esuiss.ui.components.RadialBarChart
import com.esuiss.ui.components.chartColor
import com.esuiss.ui.theme.EsuissTheme
import com.esuiss.ui.theme.Typography

private class RadialProgressReading(val value: Double)

private val chartData = listOf(RadialProgressReading(64.0))

private val chartConfig = ChartConfig(
    "value" to ChartConfigItem("Reading") { chart4 },
)

@Composable
fun RadialChartProgress(modifier: Modifier = Modifier) {
    val colors = EsuissTheme.colors
    Card(modifier, variant = CardVariant.Filled, size = CardSize.Sm) {
        CardHeader("Goal progress", description = "A three-quarter arc")
        CardContent {
            Box(
                Modifier
                    .fillMaxWidth()
                    .height(208.dp),
            ) {
                ChartContainer(chartConfig, Modifier.matchParentSize()) {
                    val color = chartColor("value")
                    RadialBarChart(
                        chartData,
                        innerRadius = 0.72f,
                        outerRadius = 1f,
                        startAngle = 225f,
                        endAngle = -45f,
                        barSize = 16.dp,
                        accessibilityLabel = "Goal progress, 16 / 25 books · 2026",
                    ) {
                        PolarAngleAxis(0.0..100.0)
                        RadialBar("value", value = { it.value }, cornerRadius = 20.dp, background = color.copy(alpha = color.alpha * 0.22f))
                    }
                }
                Column(
                    Modifier
                        .align(Alignment.Center)
                        .clearAndSetSemantics {},
                    horizontalAlignment = Alignment.CenterHorizontally,
                ) {
                    BasicText(
                        "16 / 25",
                        style = Typography.xl3.copy(color = colors.foreground, fontWeight = FontWeight.SemiBold, fontFeatureSettings = "tnum"),
                    )
                    BasicText("books · 2026", style = Typography.xs.copy(color = colors.mutedForeground))
                }
            }
        }
    }
}
```

**React Native, SwiftUI**

A `RadialBarChart` drawn from 225 to -45 degrees, with one value on a 0 to 100 `PolarAngleAxis` over a tinted track. The "16 / 25" count and caption are `Text` layered in the center. Nothing is interactive.

**React Native**

Change the `value` in `chartData` (0 to 100) and the centered text to match it; the label and color live in `chartConfig`. The component takes no props.

**React Native, SwiftUI, Jetpack Compose**

### Installation

**Command**

**React Native**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-progress
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-progress
```

**SwiftUI**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-progress
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-progress --platform swift
```

**Jetpack Compose**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-progress
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-progress --platform kotlin
```

**React Native**

The CLI also adds what it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

**React Native, SwiftUI, Jetpack Compose**

**Manual**

**React Native**

**Uniwind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

2. Copy and paste the following code into `components/charts/radial-chart-progress.tsx`:

- `uniwind/components/charts/radial-chart-progress.tsx`: shown above

3. Update the import paths to match your project setup.

**NativeWind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

2. Copy and paste the following code into `components/charts/radial-chart-progress.tsx`:

```tsx title="nativewind/components/charts/radial-chart-progress.tsx"
import { View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"

const chartData = [{ name: "value", value: 64 }]

const chartConfig = {
  value: { label: "Reading", color: "chart-4" },
} satisfies ChartConfig

export function RadialChartProgress() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Goal progress</CardTitle>
        <CardDescription>A three-quarter arc</CardDescription>
      </CardHeader>
      <CardContent>
        <View>
          <View
            pointerEvents="none"
            className="absolute inset-0 items-center justify-center"
          >
            <Text className="text-3xl font-semibold tracking-tight tabular-nums">
              16 / 25
            </Text>
            <Text className="text-xs text-muted-foreground">books · 2026</Text>
          </View>
          <ChartContainer
            config={chartConfig}
            accessibilityLabel="Goal progress"
            className="h-52 w-full"
          >
            <RadialBarChart
              data={chartData}
              innerRadius="72%"
              outerRadius="100%"
              startAngle={225}
              endAngle={-45}
              barSize={16}
            >
              <PolarAngleAxis domain={[0, 100]} />
              <RadialBar
                dataKey="value"
                cornerRadius={20}
                background={{ fillOpacity: 0.22 }}
              />
            </RadialBarChart>
          </ChartContainer>
        </View>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**StyleSheet**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

2. Copy and paste the following code into `components/charts/radial-chart-progress.tsx`:

```tsx title="stylesheet/components/charts/radial-chart-progress.tsx"
import { StyleSheet, View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"
import { fontSize, useTheme } from "@/components/ui/theme"

const chartData = [{ name: "value", value: 64 }]

const chartConfig = {
  value: { label: "Reading", color: "chart-4" },
} satisfies ChartConfig

const styles = StyleSheet.create({
  overlay: {
    ...StyleSheet.absoluteFill,
    alignItems: "center",
    justifyContent: "center",
  },
  value: {
    ...fontSize["3xl"],
    fontWeight: "600",
    letterSpacing: -0.75,
    fontVariant: ["tabular-nums"],
  },
  caption: { ...fontSize.xs },
  chart: { height: 208 },
})

export function RadialChartProgress() {
  const { colors } = useTheme()
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Goal progress</CardTitle>
        <CardDescription>A three-quarter arc</CardDescription>
      </CardHeader>
      <CardContent>
        <View>
          <View pointerEvents="none" style={styles.overlay}>
            <Text style={styles.value}>16 / 25</Text>
            <Text style={[styles.caption, { color: colors.mutedForeground }]}>
              books · 2026
            </Text>
          </View>
          <ChartContainer
            config={chartConfig}
            accessibilityLabel="Goal progress"
            style={styles.chart}
          >
            <RadialBarChart
              data={chartData}
              innerRadius="72%"
              outerRadius="100%"
              startAngle={225}
              endAngle={-45}
              barSize={16}
            >
              <PolarAngleAxis domain={[0, 100]} />
              <RadialBar
                dataKey="value"
                cornerRadius={20}
                background={{ fillOpacity: 0.22 }}
              />
            </RadialBarChart>
          </ChartContainer>
        </View>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**SwiftUI**

1. Target iOS 17 or later.

2. Copy the theme files every view uses:

- `swift/Theme/Theme.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Theme.swift)

- `swift/Theme/Tokens.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Tokens.swift)

3. Copy the source and every file it uses:

- `swift/Charts/RadialChartProgress.swift`: shown above

- `swift/Components/Card.swift`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `swift/Components/Chart.swift`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `swift/Components/Haptics.swift`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `swift/Components/Item.swift`: see [Item](https://suiss.app/ui/docs/components/item.md)

- `swift/Components/Separator.swift`: see [Separator](https://suiss.app/ui/docs/components/separator.md)

4. Add the files to your app target.

**Jetpack Compose**

1. Apply the Compose compiler plugin, enable Compose, set `compileSdk` to 37 or higher and `minSdk` to 24 or higher, and add the dependencies:

```kotlin title="build.gradle.kts"
plugins {
    id("org.jetbrains.kotlin.plugin.compose")
}

android {
    compileSdk = 37
    defaultConfig { minSdk = 24 }
    buildFeatures { compose = true }
}

dependencies {
    implementation(platform("androidx.compose:compose-bom:2026.09.00"))
    implementation("androidx.compose.foundation:foundation")
    implementation("androidx.compose.ui:ui")
}
```

2. Copy the theme files every view uses:

- `kotlin/theme/Theme.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Theme.kt)

- `kotlin/theme/Tokens.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Tokens.kt)

3. Copy the source and every file it uses:

- `kotlin/charts/RadialChartProgress.kt`: shown above

- `kotlin/components/Card.kt`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `kotlin/components/Chart.kt`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `kotlin/components/Content.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/Content.kt)

- `kotlin/components/FormSupport.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/FormSupport.kt)

- `kotlin/components/Haptics.kt`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `kotlin/components/Icon.kt`: see [Icon](https://suiss.app/ui/docs/components/icon.md)

4. Update the `com.esuiss.ui` package names to match your project.

**React Native, SwiftUI, Jetpack Compose**

### Usage

**React Native**

```tsx
import { RadialChartProgress } from "@/components/charts/radial-chart-progress"
```

```tsx
<RadialChartProgress />
```

**SwiftUI**

```swift
import SwiftUI

struct RadialProgressExample: View {
  var body: some View {
    RadialChartProgress()
  }
}
```

**Jetpack Compose**

```kotlin
import androidx.compose.runtime.Composable
import com.esuiss.ui.charts.RadialChartProgress

@Composable
fun RadialProgressExample() {
    RadialChartProgress()
}
```



## Radial Chart Rings

Three nested activity rings for move, exercise and stand, drawn as plain SVG circles.

Source: https://suiss.app/ui/docs/charts/radial-chart#rings

**React**

**Example**

```tsx title="components/charts/radial-chart-rings.tsx"
"use client"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"

const rings = [
  {
    key: "move",
    label: "Move",
    value: 720,
    goal: 600,
    color: "var(--color-red-500)",
  },
  {
    key: "exercise",
    label: "Exercise",
    value: 62,
    goal: 30,
    color: "var(--color-green-500)",
  },
  {
    key: "stand",
    label: "Stand",
    value: 12,
    goal: 12,
    color: "var(--color-cyan-500)",
  },
]

const SIZE = 200
const BAR = 16

export function RadialChartRings() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Activity rings</CardTitle>
        <CardDescription>Move, exercise and stand</CardDescription>
      </CardHeader>
      <CardContent className="flex justify-center">
        <svg
          role="img"
          aria-label={rings
            .map((ring) => `${ring.label} ${ring.value} of ${ring.goal}`)
            .join(", ")}
          viewBox={`0 0 ${SIZE} ${SIZE}`}
          className="size-50 -rotate-90"
        >
          {rings.map((ring, index) => {
            const radius = SIZE / 2 - BAR / 2 - index * (BAR + 2)
            const circumference = 2 * Math.PI * radius
            const progress = Math.min(1, ring.value / ring.goal)
            return (
              <g key={ring.key}>
                <circle
                  cx={SIZE / 2}
                  cy={SIZE / 2}
                  r={radius}
                  fill="none"
                  strokeWidth={BAR}
                  stroke={`color-mix(in oklab, ${ring.color} 22%, transparent)`}
                />
                <circle
                  cx={SIZE / 2}
                  cy={SIZE / 2}
                  r={radius}
                  fill="none"
                  strokeWidth={BAR}
                  strokeLinecap="round"
                  stroke={ring.color}
                  strokeDasharray={`${progress * circumference} ${circumference}`}
                />
              </g>
            )
          })}
        </svg>
      </CardContent>
    </Card>
  )
}
```

Three nested activity rings for move, exercise and stand, each filling toward its own goal. They are drawn as plain SVG circles, so this is the lightest option when you just need static progress rings.

Edit the `rings` array with your labels, values, goals and colors; each ring fills by value divided by goal, and a value above its goal shows a closed ring with no second lap. `SIZE` and `BAR` set the overall size and ring thickness. The graphic is exposed as an image with a label that lists each ring's value and goal.

### Installation

**Command**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-rings
```

Works in any project with a `components.json`. See [Installation](https://suiss.app/ui/docs/installation#add-components) for the one-line registry setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-rings
```

**Manual**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card).

2. Copy and paste the following code into your project.

```tsx title="components/charts/radial-chart-rings.tsx"
"use client"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"

const rings = [
  {
    key: "move",
    label: "Move",
    value: 720,
    goal: 600,
    color: "var(--color-red-500)",
  },
  {
    key: "exercise",
    label: "Exercise",
    value: 62,
    goal: 30,
    color: "var(--color-green-500)",
  },
  {
    key: "stand",
    label: "Stand",
    value: 12,
    goal: 12,
    color: "var(--color-cyan-500)",
  },
]

const SIZE = 200
const BAR = 16

export function RadialChartRings() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Activity rings</CardTitle>
        <CardDescription>Move, exercise and stand</CardDescription>
      </CardHeader>
      <CardContent className="flex justify-center">
        <svg
          role="img"
          aria-label={rings
            .map((ring) => `${ring.label} ${ring.value} of ${ring.goal}`)
            .join(", ")}
          viewBox={`0 0 ${SIZE} ${SIZE}`}
          className="size-50 -rotate-90"
        >
          {rings.map((ring, index) => {
            const radius = SIZE / 2 - BAR / 2 - index * (BAR + 2)
            const circumference = 2 * Math.PI * radius
            const progress = Math.min(1, ring.value / ring.goal)
            return (
              <g key={ring.key}>
                <circle
                  cx={SIZE / 2}
                  cy={SIZE / 2}
                  r={radius}
                  fill="none"
                  strokeWidth={BAR}
                  stroke={`color-mix(in oklab, ${ring.color} 22%, transparent)`}
                />
                <circle
                  cx={SIZE / 2}
                  cy={SIZE / 2}
                  r={radius}
                  fill="none"
                  strokeWidth={BAR}
                  strokeLinecap="round"
                  stroke={ring.color}
                  strokeDasharray={`${progress * circumference} ${circumference}`}
                />
              </g>
            )
          })}
        </svg>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

### Usage

```tsx
import { RadialChartRings } from "@/components/charts/radial-chart-rings"
```

```tsx
<RadialChartRings />
```

**React Native, SwiftUI, Jetpack Compose**

```tsx title="uniwind/components/charts/radial-chart-rings.tsx"
import { View } from "react-native"
import Svg, { Circle, G } from "react-native-svg"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import { type ChartColor, ChartPalette } from "@/components/ui/chart"

const rings: {
  key: string
  label: string
  value: number
  goal: number
  color: ChartColor
}[] = [
  { key: "move", label: "Move", value: 720, goal: 600, color: "red-500" },
  {
    key: "exercise",
    label: "Exercise",
    value: 62,
    goal: 30,
    color: "green-500",
  },
  { key: "stand", label: "Stand", value: 12, goal: 12, color: "cyan-500" },
]

const SIZE = 200
const BAR = 16

export function RadialChartRings() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Activity rings</CardTitle>
        <CardDescription>Move, exercise and stand</CardDescription>
      </CardHeader>
      <CardContent className="items-center">
        <View
          accessible
          role="img"
          accessibilityLabel={rings
            .map((ring) => `${ring.label} ${ring.value} of ${ring.goal}`)
            .join(", ")}
        >
          <ChartPalette colors={rings.map((ring) => ring.color)}>
            {(palette) => (
              <Svg width={SIZE} height={SIZE} viewBox={`0 0 ${SIZE} ${SIZE}`}>
                <G rotation={-90} origin={`${SIZE / 2}, ${SIZE / 2}`}>
                  {rings.map((ring, index) => {
                    const radius = SIZE / 2 - BAR / 2 - index * (BAR + 2)
                    const circumference = 2 * Math.PI * radius
                    const progress = Math.min(1, ring.value / ring.goal)
                    const color = palette[ring.color]
                    return (
                      <G key={ring.key}>
                        <Circle
                          cx={SIZE / 2}
                          cy={SIZE / 2}
                          r={radius}
                          fill="none"
                          strokeWidth={BAR}
                          stroke={color}
                          strokeOpacity={0.22}
                        />
                        <Circle
                          cx={SIZE / 2}
                          cy={SIZE / 2}
                          r={radius}
                          fill="none"
                          strokeWidth={BAR}
                          strokeLinecap="round"
                          stroke={color}
                          strokeDasharray={`${progress * circumference} ${circumference}`}
                        />
                      </G>
                    )
                  })}
                </G>
              </Svg>
            )}
          </ChartPalette>
        </View>
      </CardContent>
    </Card>
  )
}
```

```swift title="swift/Charts/RadialChartRings.swift"
import SwiftUI

private let rings: [(key: String, label: String, value: Double, goal: Double, color: Color)] = [
  ("move", "Move", 720, 600, Palette.red500),
  ("exercise", "Exercise", 62, 30, Palette.green500),
  ("stand", "Stand", 12, 12, Palette.cyan500),
]

private let size: CGFloat = 200
private let bar: CGFloat = 16

public struct RadialChartRings: View {
  public init() {}

  public var body: some View {
    Card(.filled, size: .sm) {
      CardHeader("Activity rings", description: "Move, exercise and stand")
      CardContent {
        ZStack {
          ForEach(rings.indices, id: \.self) { index in
            let ring = rings[index]
            let radius = size / 2 - bar / 2 - CGFloat(index) * (bar + 2)
            Circle()
              .stroke(ring.color.opacity(0.22), lineWidth: bar)
              .frame(width: radius * 2, height: radius * 2)
            Circle()
              .trim(from: 0, to: min(1, ring.value / ring.goal))
              .stroke(ring.color, style: StrokeStyle(lineWidth: bar, lineCap: .round))
              .rotationEffect(.degrees(-90))
              .frame(width: radius * 2, height: radius * 2)
          }
        }
        .frame(width: size, height: size)
        .frame(maxWidth: .infinity)
        .accessibilityElement(children: .ignore)
        .accessibilityLabel(Text(verbatim: rings.map { "\($0.label) \(Int($0.value)) of \(Int($0.goal))" }.joined(separator: ", ")))
      }
    }
  }
}
```

```kt title="kotlin/charts/RadialChartRings.kt"
package com.esuiss.ui.charts

import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.graphics.drawscope.DrawScope
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Card
import com.esuiss.ui.components.CardContent
import com.esuiss.ui.components.CardHeader
import com.esuiss.ui.components.CardSize
import com.esuiss.ui.components.CardVariant
import com.esuiss.ui.theme.Colors
import com.esuiss.ui.theme.EsuissTheme
import com.esuiss.ui.theme.Palette
import kotlin.math.min

private class RadialRingsRing(val label: String, val value: Double, val goal: Double, val color: Colors.() -> Color)

private val rings = listOf(
    RadialRingsRing("Move", 720.0, 600.0) { Palette.red500 },
    RadialRingsRing("Exercise", 62.0, 30.0) { Palette.green500 },
    RadialRingsRing("Stand", 12.0, 12.0) { Palette.cyan500 },
)

internal fun DrawScope.drawActivityRing(color: Color, radius: Float, bar: Float, progress: Float) {
    val center = Offset(size.width / 2, size.height / 2)
    val topLeft = Offset(center.x - radius, center.y - radius)
    val arc = Size(radius * 2, radius * 2)
    drawCircle(color.copy(alpha = color.alpha * 0.22f), radius, center, style = Stroke(bar))
    if (progress > 0.001f) {
        drawArc(color, -90f, 360f * progress, false, topLeft, arc, style = Stroke(bar, cap = StrokeCap.Round))
    }
}

@Composable
fun RadialChartRings(modifier: Modifier = Modifier) {
    val colors = EsuissTheme.colors
    Card(modifier, variant = CardVariant.Filled, size = CardSize.Sm) {
        CardHeader("Activity rings", description = "Move, exercise and stand")
        CardContent {
            Box(Modifier.fillMaxWidth(), contentAlignment = Alignment.Center) {
                RingsCanvas(
                    values = rings.map { min(1.0, it.value / it.goal).toFloat() },
                    colors = rings.map { it.color(colors) },
                    size = 200.dp,
                    bar = 16.dp,
                    gap = 2.dp,
                    modifier = Modifier.clearAndSetSemantics {
                        contentDescription = rings.joinToString(", ") { "${it.label} ${it.value.toInt()} of ${it.goal.toInt()}" }
                    },
                )
            }
        }
    }
}

@Composable
internal fun RingsCanvas(values: List<Float>, colors: List<Color>, size: Dp, bar: Dp, gap: Dp, modifier: Modifier = Modifier) {
    Canvas(modifier.size(size)) {
        val stroke = bar.toPx()
        values.forEachIndexed { index, progress ->
            val radius = this.size.width / 2 - stroke / 2 - index * (stroke + gap.toPx())
            drawActivityRing(colors[index], radius, stroke, progress.coerceIn(0f, 1f))
        }
    }
}
```

**React Native**

Three rings drawn with `Svg` circles colored through `ChartPalette`. Each entry in `rings` has a value and a goal, and the filled arc is capped at a full circle. The whole graphic is one accessible image whose label lists each ring's value and goal. Nothing is interactive.

Replace the values, goals and colors in `rings`, and change `SIZE` and `BAR` to resize the rings. The component takes no props.

**React Native, SwiftUI, Jetpack Compose**

### Installation

**Command**

**React Native**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-rings
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-rings
```

**SwiftUI**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-rings
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-rings --platform swift
```

**Jetpack Compose**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-rings
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-rings --platform kotlin
```

**React Native**

The CLI also adds what it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

**React Native, SwiftUI, Jetpack Compose**

**Manual**

**React Native**

**Uniwind**

1. Install the following dependencies:

```bash title="Terminal"
npx expo install react-native-svg
```

2. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

3. Copy and paste the following code into `components/charts/radial-chart-rings.tsx`:

- `uniwind/components/charts/radial-chart-rings.tsx`: shown above

4. Update the import paths to match your project setup.

**NativeWind**

1. Install the following dependencies:

```bash title="Terminal"
npx expo install react-native-svg
```

2. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

3. Copy and paste the following code into `components/charts/radial-chart-rings.tsx`:

```tsx title="nativewind/components/charts/radial-chart-rings.tsx"
import { View } from "react-native"
import Svg, { Circle, G } from "react-native-svg"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import { type ChartColor, ChartPalette } from "@/components/ui/chart"

const rings: {
  key: string
  label: string
  value: number
  goal: number
  color: ChartColor
}[] = [
  { key: "move", label: "Move", value: 720, goal: 600, color: "red-500" },
  {
    key: "exercise",
    label: "Exercise",
    value: 62,
    goal: 30,
    color: "green-500",
  },
  { key: "stand", label: "Stand", value: 12, goal: 12, color: "cyan-500" },
]

const SIZE = 200
const BAR = 16

export function RadialChartRings() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Activity rings</CardTitle>
        <CardDescription>Move, exercise and stand</CardDescription>
      </CardHeader>
      <CardContent className="items-center">
        <View
          accessible
          role="img"
          accessibilityLabel={rings
            .map((ring) => `${ring.label} ${ring.value} of ${ring.goal}`)
            .join(", ")}
        >
          <ChartPalette colors={rings.map((ring) => ring.color)}>
            {(palette) => (
              <Svg width={SIZE} height={SIZE} viewBox={`0 0 ${SIZE} ${SIZE}`}>
                <G rotation={-90} origin={`${SIZE / 2}, ${SIZE / 2}`}>
                  {rings.map((ring, index) => {
                    const radius = SIZE / 2 - BAR / 2 - index * (BAR + 2)
                    const circumference = 2 * Math.PI * radius
                    const progress = Math.min(1, ring.value / ring.goal)
                    const color = palette[ring.color]
                    return (
                      <G key={ring.key}>
                        <Circle
                          cx={SIZE / 2}
                          cy={SIZE / 2}
                          r={radius}
                          fill="none"
                          strokeWidth={BAR}
                          stroke={color}
                          strokeOpacity={0.22}
                        />
                        <Circle
                          cx={SIZE / 2}
                          cy={SIZE / 2}
                          r={radius}
                          fill="none"
                          strokeWidth={BAR}
                          strokeLinecap="round"
                          stroke={color}
                          strokeDasharray={`${progress * circumference} ${circumference}`}
                        />
                      </G>
                    )
                  })}
                </G>
              </Svg>
            )}
          </ChartPalette>
        </View>
      </CardContent>
    </Card>
  )
}
```

4. Update the import paths to match your project setup.

**StyleSheet**

1. Install the following dependencies:

```bash title="Terminal"
npx expo install react-native-svg
```

2. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

3. Copy and paste the following code into `components/charts/radial-chart-rings.tsx`:

```tsx title="stylesheet/components/charts/radial-chart-rings.tsx"
import { View } from "react-native"
import Svg, { Circle, G } from "react-native-svg"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import { type ChartColor, ChartPalette } from "@/components/ui/chart"

const rings: {
  key: string
  label: string
  value: number
  goal: number
  color: ChartColor
}[] = [
  { key: "move", label: "Move", value: 720, goal: 600, color: "red-500" },
  {
    key: "exercise",
    label: "Exercise",
    value: 62,
    goal: 30,
    color: "green-500",
  },
  { key: "stand", label: "Stand", value: 12, goal: 12, color: "cyan-500" },
]

const SIZE = 200
const BAR = 16

export function RadialChartRings() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Activity rings</CardTitle>
        <CardDescription>Move, exercise and stand</CardDescription>
      </CardHeader>
      <CardContent style={{ alignItems: "center" }}>
        <View
          accessible
          role="img"
          accessibilityLabel={rings
            .map((ring) => `${ring.label} ${ring.value} of ${ring.goal}`)
            .join(", ")}
        >
          <ChartPalette colors={rings.map((ring) => ring.color)}>
            {(palette) => (
              <Svg width={SIZE} height={SIZE} viewBox={`0 0 ${SIZE} ${SIZE}`}>
                <G rotation={-90} origin={`${SIZE / 2}, ${SIZE / 2}`}>
                  {rings.map((ring, index) => {
                    const radius = SIZE / 2 - BAR / 2 - index * (BAR + 2)
                    const circumference = 2 * Math.PI * radius
                    const progress = Math.min(1, ring.value / ring.goal)
                    const color = palette[ring.color]
                    return (
                      <G key={ring.key}>
                        <Circle
                          cx={SIZE / 2}
                          cy={SIZE / 2}
                          r={radius}
                          fill="none"
                          strokeWidth={BAR}
                          stroke={color}
                          strokeOpacity={0.22}
                        />
                        <Circle
                          cx={SIZE / 2}
                          cy={SIZE / 2}
                          r={radius}
                          fill="none"
                          strokeWidth={BAR}
                          strokeLinecap="round"
                          stroke={color}
                          strokeDasharray={`${progress * circumference} ${circumference}`}
                        />
                      </G>
                    )
                  })}
                </G>
              </Svg>
            )}
          </ChartPalette>
        </View>
      </CardContent>
    </Card>
  )
}
```

4. Update the import paths to match your project setup.

**SwiftUI**

1. Target iOS 17 or later.

2. Copy the theme files every view uses:

- `swift/Theme/Theme.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Theme.swift)

- `swift/Theme/Tokens.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Tokens.swift)

3. Copy the source and every file it uses:

- `swift/Charts/RadialChartRings.swift`: shown above

- `swift/Components/Card.swift`: see [Card](https://suiss.app/ui/docs/components/card.md)

4. Add the files to your app target.

**Jetpack Compose**

1. Apply the Compose compiler plugin, enable Compose, set `compileSdk` to 37 or higher and `minSdk` to 24 or higher, and add the dependencies:

```kotlin title="build.gradle.kts"
plugins {
    id("org.jetbrains.kotlin.plugin.compose")
}

android {
    compileSdk = 37
    defaultConfig { minSdk = 24 }
    buildFeatures { compose = true }
}

dependencies {
    implementation(platform("androidx.compose:compose-bom:2026.09.00"))
    implementation("androidx.compose.foundation:foundation")
    implementation("androidx.compose.ui:ui")
}
```

2. Copy the theme files every view uses:

- `kotlin/theme/Theme.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Theme.kt)

- `kotlin/theme/Tokens.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Tokens.kt)

3. Copy the source and every file it uses:

- `kotlin/charts/RadialChartRings.kt`: shown above

- `kotlin/components/Card.kt`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `kotlin/components/Content.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/Content.kt)

4. Update the `com.esuiss.ui` package names to match your project.

**React Native, SwiftUI, Jetpack Compose**

### Usage

**React Native**

```tsx
import { RadialChartRings } from "@/components/charts/radial-chart-rings"
```

```tsx
<RadialChartRings />
```

**SwiftUI**

```swift
import SwiftUI

struct RadialRingsExample: View {
  var body: some View {
    RadialChartRings()
  }
}
```

**Jetpack Compose**

```kotlin
import androidx.compose.runtime.Composable
import com.esuiss.ui.charts.RadialChartRings

@Composable
fun RadialRingsExample() {
    RadialChartRings()
}
```



## Radial Chart Stacked

A half-circle arc with two series stacked end to end and the combined total beneath it.

Source: https://suiss.app/ui/docs/charts/radial-chart#stacked

**React**

**Example**

```tsx title="components/charts/radial-chart-stacked.tsx"
"use client"

import { PolarAngleAxis, RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
} from "@/components/ui/chart"

const visitors = { desktop: 1260, mobile: 570 }

const chartData = [visitors]

const chartConfig = {
  desktop: { label: "Desktop", color: "var(--chart-1)" },
  mobile: { label: "Mobile", color: "var(--chart-2)" },
} satisfies ChartConfig

const total = visitors.desktop + visitors.mobile

export function RadialChartStacked() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Half, stacked</CardTitle>
        <CardDescription>Two series on one arc</CardDescription>
      </CardHeader>
      <CardContent>
        <div className="relative">
          <ChartContainer
            config={chartConfig}
            className="aspect-auto h-44 w-full"
          >
            <RadialBarChart
              accessibilityLayer
              data={chartData}
              startAngle={180}
              endAngle={0}
              innerRadius="120%"
              outerRadius="170%"
              cy="86%"
            >
              <PolarAngleAxis
                type="number"
                domain={[0, total]}
                tick={false}
                axisLine={false}
              />
              <ChartTooltip
                cursor={false}
                content={<ChartTooltipContent hideLabel />}
              />
              <RadialBar
                dataKey="desktop"
                stackId="a"
                cornerRadius={6}
                fill="var(--color-desktop)"
                stroke="var(--muted)"
                strokeWidth={3}
              />
              <RadialBar
                dataKey="mobile"
                stackId="a"
                cornerRadius={6}
                fill="var(--color-mobile)"
                stroke="var(--muted)"
                strokeWidth={3}
              />
            </RadialBarChart>
          </ChartContainer>
          <div className="pointer-events-none absolute inset-x-0 bottom-[14%] flex flex-col items-center text-center">
            <span className="text-2xl font-semibold tracking-tight tabular-nums">
              {total.toLocaleString("en-US")}
            </span>
            <span className="text-xs text-muted-foreground">visitors</span>
          </div>
        </div>
      </CardContent>
    </Card>
  )
}
```

A half-circle arc where two series sit end to end and the combined total appears beneath. Use it to show a split of one total, like desktop versus mobile visitors, in a compact space.

Set your series values in `visitors`, add a label and color for each key to `chartConfig`, and add one `RadialBar` per series with the same `stackId`. The arc's scale is the total, so the bars always fill it. The tooltip shows both values whichever segment you hover.

### Installation

**Command**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-stacked
```

Works in any project with a `components.json`. See [Installation](https://suiss.app/ui/docs/installation#add-components) for the one-line registry setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-stacked
```

**Manual**

1. Install the following dependencies:

```bash title="Terminal"
npm install recharts
```

2. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

3. Copy and paste the following code into your project.

```tsx title="components/charts/radial-chart-stacked.tsx"
"use client"

import { PolarAngleAxis, RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
} from "@/components/ui/chart"

const visitors = { desktop: 1260, mobile: 570 }

const chartData = [visitors]

const chartConfig = {
  desktop: { label: "Desktop", color: "var(--chart-1)" },
  mobile: { label: "Mobile", color: "var(--chart-2)" },
} satisfies ChartConfig

const total = visitors.desktop + visitors.mobile

export function RadialChartStacked() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Half, stacked</CardTitle>
        <CardDescription>Two series on one arc</CardDescription>
      </CardHeader>
      <CardContent>
        <div className="relative">
          <ChartContainer
            config={chartConfig}
            className="aspect-auto h-44 w-full"
          >
            <RadialBarChart
              accessibilityLayer
              data={chartData}
              startAngle={180}
              endAngle={0}
              innerRadius="120%"
              outerRadius="170%"
              cy="86%"
            >
              <PolarAngleAxis
                type="number"
                domain={[0, total]}
                tick={false}
                axisLine={false}
              />
              <ChartTooltip
                cursor={false}
                content={<ChartTooltipContent hideLabel />}
              />
              <RadialBar
                dataKey="desktop"
                stackId="a"
                cornerRadius={6}
                fill="var(--color-desktop)"
                stroke="var(--muted)"
                strokeWidth={3}
              />
              <RadialBar
                dataKey="mobile"
                stackId="a"
                cornerRadius={6}
                fill="var(--color-mobile)"
                stroke="var(--muted)"
                strokeWidth={3}
              />
            </RadialBarChart>
          </ChartContainer>
          <div className="pointer-events-none absolute inset-x-0 bottom-[14%] flex flex-col items-center text-center">
            <span className="text-2xl font-semibold tracking-tight tabular-nums">
              {total.toLocaleString("en-US")}
            </span>
            <span className="text-xs text-muted-foreground">visitors</span>
          </div>
        </div>
      </CardContent>
    </Card>
  )
}
```

4. Update the import paths to match your project setup.

### Usage

```tsx
import { RadialChartStacked } from "@/components/charts/radial-chart-stacked"
```

```tsx
<RadialChartStacked />
```

**React Native, SwiftUI, Jetpack Compose**

```tsx title="uniwind/components/charts/radial-chart-stacked.tsx"
import { View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"

const visitors = { desktop: 1260, mobile: 570 }

const chartData = [visitors]

const chartConfig = {
  desktop: { label: "Desktop", color: "chart-1" },
  mobile: { label: "Mobile", color: "chart-2" },
} satisfies ChartConfig

const total = visitors.desktop + visitors.mobile

function formatTotal(value: number) {
  try {
    return new Intl.NumberFormat("en-US").format(value)
  } catch {
    return String(value).replace(/\B(?=(\d{3})+(?!\d))/g, ",")
  }
}

export function RadialChartStacked() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Half, stacked</CardTitle>
        <CardDescription>Two series on one arc</CardDescription>
      </CardHeader>
      <CardContent>
        <View>
          <View
            pointerEvents="none"
            className="absolute inset-x-0 bottom-[14%] items-center"
          >
            <Text className="text-2xl font-semibold tracking-tight tabular-nums">
              {formatTotal(total)}
            </Text>
            <Text className="text-xs text-muted-foreground">visitors</Text>
          </View>
          <ChartContainer
            config={chartConfig}
            accessibilityLabel="Half, stacked"
            className="h-44 w-full"
          >
            <RadialBarChart
              data={chartData}
              startAngle={180}
              endAngle={0}
              innerRadius="120%"
              outerRadius="170%"
              cy="86%"
            >
              <PolarAngleAxis domain={[0, total]} />
              <ChartTooltip
                cursor={false}
                content={<ChartTooltipContent hideLabel />}
              />
              <RadialBar
                dataKey="desktop"
                stackId="a"
                cornerRadius={6}
                fill="chart-1"
                stroke="muted"
                strokeWidth={3}
              />
              <RadialBar
                dataKey="mobile"
                stackId="a"
                cornerRadius={6}
                fill="chart-2"
                stroke="muted"
                strokeWidth={3}
              />
            </RadialBarChart>
          </ChartContainer>
        </View>
      </CardContent>
    </Card>
  )
}
```

```swift title="swift/Charts/RadialChartStacked.swift"
import Charts
import SwiftUI

private let visitors: [(key: String, value: Double)] = [("desktop", 1260), ("mobile", 570)]

private let chartConfig: ChartConfig = [
  "desktop": .init("Desktop", color: EsuissColor.chart1),
  "mobile": .init("Mobile", color: EsuissColor.chart2),
]

private let total = visitors.reduce(0) { $0 + $1.value }

public struct RadialChartStacked: View {
  @State private var selection: Int?

  public init() {}

  public var body: some View {
    let outer: CGFloat = 141.1
    Card(.filled, size: .sm) {
      CardHeader("Half, stacked", description: "Two series on one arc")
      CardContent {
        ChartContainer(config: chartConfig) {
          ChartAnimator { progress in
            Chart {
              ForEach(visitors, id: \.key) { item in
                SectorMark(angle: .value("Visitors", item.value * progress), innerRadius: .ratio(0.706), angularInset: 1.5)
                  .cornerRadius(6)
                  .foregroundStyle(chartConfig.color(item.key))
              }
              ChartSectorRest(total: total, progress: progress)
              SectorMark(angle: .value("Visitors", total))
                .foregroundStyle(.clear)
            }
            .contentShape(Rectangle().size(width: outer + 28, height: outer * 2).offset(x: outer - 28))
            .chartTooltip(
              angle: visitors.map(\.value),
              labels: visitors.map { chartConfig.label($0.key) },
              startAngle: .degrees(-90),
              endAngle: .degrees(90),
              innerRadius: 0.706,
              selection: $selection,
              accessibilityLabel: "Half, stacked",
              items: { _ in visitors.map { ChartTooltipItem($0.key, value: $0.value) } }
            ) { payload in
              ChartTooltipContent(payload, hideLabel: true)
            }
            .frame(width: outer * 2, height: outer * 2)
            .padding(.top, 6.7)
            .frame(maxWidth: .infinity)
            .frame(height: 176, alignment: .top)
            .overlay(alignment: .bottom) {
              VStack(spacing: 0) {
                Text(total, format: .number)
                  .textStyle(.xl2, weight: .semibold)
                  .monospacedDigit()
                Text("visitors")
                  .textStyle(.xs)
                  .foregroundStyle(EsuissColor.mutedForeground)
              }
              .padding(.bottom, 176 * 0.14)
              .allowsHitTesting(false)
              .accessibilityHidden(true)
            }
          }
        }
        .frame(height: 176)
      }
    }
  }
}
```

```kt title="kotlin/charts/RadialChartStacked.kt"
package com.esuiss.ui.charts

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.text.BasicText
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Card
import com.esuiss.ui.components.CardContent
import com.esuiss.ui.components.CardHeader
import com.esuiss.ui.components.CardSize
import com.esuiss.ui.components.CardVariant
import com.esuiss.ui.components.ChartConfig
import com.esuiss.ui.components.ChartConfigItem
import com.esuiss.ui.components.ChartContainer
import com.esuiss.ui.components.ChartTooltipContent
import com.esuiss.ui.components.RadialBarChart
import com.esuiss.ui.theme.EsuissTheme
import com.esuiss.ui.theme.Typography
import java.text.NumberFormat
import java.util.Locale

private class RadialStackedVisitors(val desktop: Double, val mobile: Double)

private val visitors = RadialStackedVisitors(1260.0, 570.0)

private val chartData = listOf(visitors)

private val chartConfig = ChartConfig(
    "desktop" to ChartConfigItem("Desktop") { chart1 },
    "mobile" to ChartConfigItem("Mobile") { chart2 },
)

private val total = visitors.desktop + visitors.mobile

@Composable
fun RadialChartStacked(modifier: Modifier = Modifier) {
    val colors = EsuissTheme.colors
    val number = NumberFormat.getNumberInstance(Locale.US)
    Card(modifier, variant = CardVariant.Filled, size = CardSize.Sm) {
        CardHeader("Half, stacked", description = "Two series on one arc")
        CardContent {
            Box(
                Modifier
                    .fillMaxWidth()
                    .height(176.dp),
            ) {
                ChartContainer(chartConfig, Modifier.matchParentSize()) {
                    RadialBarChart(
                        chartData,
                        startAngle = 180f,
                        endAngle = 0f,
                        innerRadius = 1.2f,
                        outerRadius = 1.7f,
                        cy = 0.86f,
                        accessibilityLabel = "Half, stacked, ${number.format(total)} visitors",
                    ) {
                        PolarAngleAxis(0.0..total)
                        ChartTooltip { ChartTooltipContent(hideLabel = true) }
                        RadialBar("desktop", value = { it.desktop }, stackId = "a", cornerRadius = 6.dp, stroke = colors.muted, strokeWidth = 3.dp)
                        RadialBar("mobile", value = { it.mobile }, stackId = "a", cornerRadius = 6.dp, stroke = colors.muted, strokeWidth = 3.dp)
                    }
                }
                Column(
                    Modifier
                        .align(Alignment.BottomCenter)
                        .padding(bottom = 24.6.dp)
                        .clearAndSetSemantics {},
                    horizontalAlignment = Alignment.CenterHorizontally,
                ) {
                    BasicText(
                        number.format(total),
                        style = Typography.xl2.copy(color = colors.foreground, fontWeight = FontWeight.SemiBold, fontFeatureSettings = "tnum"),
                    )
                    BasicText("visitors", style = Typography.xs.copy(color = colors.mutedForeground))
                }
            }
        }
    }
}
```

**React Native**

A `RadialBarChart` drawn from 180 to 0 degrees, with two `RadialBar` series sharing a `stackId` on a domain equal to their sum. `chartData` is a single record with `desktop` and `mobile` counts, and the total is `Text` under the arc. Pressing the arc shows a tooltip.

Replace the counts in `visitors`; the total and domain follow. Rename the series in `chartConfig` and in the `RadialBar` `dataKey` and `fill` props. The component takes no props.

**React Native, SwiftUI, Jetpack Compose**

### Installation

**Command**

**React Native**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-stacked
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-stacked
```

**SwiftUI**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-stacked
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-stacked --platform swift
```

**Jetpack Compose**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-stacked
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-stacked --platform kotlin
```

**React Native**

The CLI also adds what it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

**React Native, SwiftUI, Jetpack Compose**

**Manual**

**React Native**

**Uniwind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

2. Copy and paste the following code into `components/charts/radial-chart-stacked.tsx`:

- `uniwind/components/charts/radial-chart-stacked.tsx`: shown above

3. Update the import paths to match your project setup.

**NativeWind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

2. Copy and paste the following code into `components/charts/radial-chart-stacked.tsx`:

```tsx title="nativewind/components/charts/radial-chart-stacked.tsx"
import { View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"

const visitors = { desktop: 1260, mobile: 570 }

const chartData = [visitors]

const chartConfig = {
  desktop: { label: "Desktop", color: "chart-1" },
  mobile: { label: "Mobile", color: "chart-2" },
} satisfies ChartConfig

const total = visitors.desktop + visitors.mobile

function formatTotal(value: number) {
  try {
    return new Intl.NumberFormat("en-US").format(value)
  } catch {
    return String(value).replace(/\B(?=(\d{3})+(?!\d))/g, ",")
  }
}

export function RadialChartStacked() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Half, stacked</CardTitle>
        <CardDescription>Two series on one arc</CardDescription>
      </CardHeader>
      <CardContent>
        <View>
          <View
            pointerEvents="none"
            className="absolute inset-x-0 bottom-[14%] items-center"
          >
            <Text className="text-2xl font-semibold tracking-tight tabular-nums">
              {formatTotal(total)}
            </Text>
            <Text className="text-xs text-muted-foreground">visitors</Text>
          </View>
          <ChartContainer
            config={chartConfig}
            accessibilityLabel="Half, stacked"
            className="h-44 w-full"
          >
            <RadialBarChart
              data={chartData}
              startAngle={180}
              endAngle={0}
              innerRadius="120%"
              outerRadius="170%"
              cy="86%"
            >
              <PolarAngleAxis domain={[0, total]} />
              <ChartTooltip
                cursor={false}
                content={<ChartTooltipContent hideLabel />}
              />
              <RadialBar
                dataKey="desktop"
                stackId="a"
                cornerRadius={6}
                fill="chart-1"
                stroke="muted"
                strokeWidth={3}
              />
              <RadialBar
                dataKey="mobile"
                stackId="a"
                cornerRadius={6}
                fill="chart-2"
                stroke="muted"
                strokeWidth={3}
              />
            </RadialBarChart>
          </ChartContainer>
        </View>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**StyleSheet**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

2. Copy and paste the following code into `components/charts/radial-chart-stacked.tsx`:

```tsx title="stylesheet/components/charts/radial-chart-stacked.tsx"
import { StyleSheet, View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"
import { fontSize, useTheme } from "@/components/ui/theme"

const visitors = { desktop: 1260, mobile: 570 }

const chartData = [visitors]

const chartConfig = {
  desktop: { label: "Desktop", color: "chart-1" },
  mobile: { label: "Mobile", color: "chart-2" },
} satisfies ChartConfig

const total = visitors.desktop + visitors.mobile

function formatTotal(value: number) {
  try {
    return new Intl.NumberFormat("en-US").format(value)
  } catch {
    return String(value).replace(/\B(?=(\d{3})+(?!\d))/g, ",")
  }
}

const styles = StyleSheet.create({
  overlay: {
    position: "absolute",
    left: 0,
    right: 0,
    bottom: "14%",
    alignItems: "center",
  },
  value: {
    ...fontSize["2xl"],
    fontWeight: "600",
    letterSpacing: -0.7,
    fontVariant: ["tabular-nums"],
  },
  caption: { ...fontSize.xs },
  chart: { height: 176 },
})

export function RadialChartStacked() {
  const { colors } = useTheme()
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Half, stacked</CardTitle>
        <CardDescription>Two series on one arc</CardDescription>
      </CardHeader>
      <CardContent>
        <View>
          <View pointerEvents="none" style={styles.overlay}>
            <Text style={styles.value}>{formatTotal(total)}</Text>
            <Text style={[styles.caption, { color: colors.mutedForeground }]}>
              visitors
            </Text>
          </View>
          <ChartContainer
            config={chartConfig}
            accessibilityLabel="Half, stacked"
            style={styles.chart}
          >
            <RadialBarChart
              data={chartData}
              startAngle={180}
              endAngle={0}
              innerRadius="120%"
              outerRadius="170%"
              cy="86%"
            >
              <PolarAngleAxis domain={[0, total]} />
              <ChartTooltip
                cursor={false}
                content={<ChartTooltipContent hideLabel />}
              />
              <RadialBar
                dataKey="desktop"
                stackId="a"
                cornerRadius={6}
                fill="chart-1"
                stroke="muted"
                strokeWidth={3}
              />
              <RadialBar
                dataKey="mobile"
                stackId="a"
                cornerRadius={6}
                fill="chart-2"
                stroke="muted"
                strokeWidth={3}
              />
            </RadialBarChart>
          </ChartContainer>
        </View>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**SwiftUI**

1. Target iOS 17 or later.

2. Copy the theme files every view uses:

- `swift/Theme/Theme.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Theme.swift)

- `swift/Theme/Tokens.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Tokens.swift)

3. Copy the source and every file it uses:

- `swift/Charts/RadialChartStacked.swift`: shown above

- `swift/Components/Card.swift`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `swift/Components/Chart.swift`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `swift/Components/Haptics.swift`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `swift/Components/Item.swift`: see [Item](https://suiss.app/ui/docs/components/item.md)

- `swift/Components/Separator.swift`: see [Separator](https://suiss.app/ui/docs/components/separator.md)

4. Add the files to your app target.

**Jetpack Compose**

1. Apply the Compose compiler plugin, enable Compose, set `compileSdk` to 37 or higher and `minSdk` to 24 or higher, and add the dependencies:

```kotlin title="build.gradle.kts"
plugins {
    id("org.jetbrains.kotlin.plugin.compose")
}

android {
    compileSdk = 37
    defaultConfig { minSdk = 24 }
    buildFeatures { compose = true }
}

dependencies {
    implementation(platform("androidx.compose:compose-bom:2026.09.00"))
    implementation("androidx.compose.foundation:foundation")
    implementation("androidx.compose.ui:ui")
}
```

2. Copy the theme files every view uses:

- `kotlin/theme/Theme.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Theme.kt)

- `kotlin/theme/Tokens.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Tokens.kt)

3. Copy the source and every file it uses:

- `kotlin/charts/RadialChartStacked.kt`: shown above

- `kotlin/components/Card.kt`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `kotlin/components/Chart.kt`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `kotlin/components/Content.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/Content.kt)

- `kotlin/components/FormSupport.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/FormSupport.kt)

- `kotlin/components/Haptics.kt`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `kotlin/components/Icon.kt`: see [Icon](https://suiss.app/ui/docs/components/icon.md)

4. Update the `com.esuiss.ui` package names to match your project.

**React Native, SwiftUI, Jetpack Compose**

### Usage

**React Native**

```tsx
import { RadialChartStacked } from "@/components/charts/radial-chart-stacked"
```

```tsx
<RadialChartStacked />
```

**SwiftUI**

```swift
import SwiftUI

struct RadialStackedExample: View {
  var body: some View {
    RadialChartStacked()
  }
}
```

**Jetpack Compose**

```kotlin
import androidx.compose.runtime.Composable
import com.esuiss.ui.charts.RadialChartStacked

@Composable
fun RadialStackedExample() {
    RadialChartStacked()
}
```



## Radial Chart Text

A single full-circle progress ring with a percentage and caption centered inside.

Source: https://suiss.app/ui/docs/charts/radial-chart#text

**React**

**Example**

```tsx title="components/charts/radial-chart-text.tsx"
"use client"

import { PolarAngleAxis, RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import { type ChartConfig, ChartContainer } from "@/components/ui/chart"

const chartData = [{ name: "value", value: 72, fill: "var(--color-value)" }]

const chartConfig = {
  value: { label: "Used", color: "var(--chart-1)" },
} satisfies ChartConfig

export function RadialChartText() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Value in the middle</CardTitle>
        <CardDescription>A single percentage</CardDescription>
      </CardHeader>
      <CardContent>
        <div className="relative">
          <ChartContainer
            config={chartConfig}
            className="aspect-auto h-52 w-full"
          >
            <RadialBarChart
              accessibilityLayer={false}
              data={chartData}
              innerRadius="72%"
              outerRadius="100%"
              startAngle={90}
              endAngle={-270}
              barSize={16}
            >
              <PolarAngleAxis
                type="number"
                domain={[0, 100]}
                tick={false}
                axisLine={false}
              />
              <RadialBar
                dataKey="value"
                cornerRadius={20}
                background={{
                  fill: "color-mix(in oklab, var(--color-value) 22%, transparent)",
                }}
              />
            </RadialBarChart>
          </ChartContainer>
          <div className="pointer-events-none absolute inset-0 justify-center flex flex-col items-center text-center">
            <span className="text-3xl font-semibold tracking-tight tabular-nums">
              72%
            </span>
            <span className="text-xs text-muted-foreground">
              cloud storage used
            </span>
          </div>
        </div>
      </CardContent>
    </Card>
  )
}
```

A single full-circle progress ring with a percentage and caption centered inside. Use it for one headline ratio, such as storage used or a completion rate.

Set the value in `chartData` and keep the `domain` on `PolarAngleAxis` at your maximum. The percentage and caption in the center are static text, so update them with the value, and change the color in `chartConfig`. There is no tooltip.

### Installation

**Command**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-text
```

Works in any project with a `components.json`. See [Installation](https://suiss.app/ui/docs/installation#add-components) for the one-line registry setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-text
```

**Manual**

1. Install the following dependencies:

```bash title="Terminal"
npm install recharts
```

2. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

3. Copy and paste the following code into your project.

```tsx title="components/charts/radial-chart-text.tsx"
"use client"

import { PolarAngleAxis, RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import { type ChartConfig, ChartContainer } from "@/components/ui/chart"

const chartData = [{ name: "value", value: 72, fill: "var(--color-value)" }]

const chartConfig = {
  value: { label: "Used", color: "var(--chart-1)" },
} satisfies ChartConfig

export function RadialChartText() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Value in the middle</CardTitle>
        <CardDescription>A single percentage</CardDescription>
      </CardHeader>
      <CardContent>
        <div className="relative">
          <ChartContainer
            config={chartConfig}
            className="aspect-auto h-52 w-full"
          >
            <RadialBarChart
              accessibilityLayer={false}
              data={chartData}
              innerRadius="72%"
              outerRadius="100%"
              startAngle={90}
              endAngle={-270}
              barSize={16}
            >
              <PolarAngleAxis
                type="number"
                domain={[0, 100]}
                tick={false}
                axisLine={false}
              />
              <RadialBar
                dataKey="value"
                cornerRadius={20}
                background={{
                  fill: "color-mix(in oklab, var(--color-value) 22%, transparent)",
                }}
              />
            </RadialBarChart>
          </ChartContainer>
          <div className="pointer-events-none absolute inset-0 justify-center flex flex-col items-center text-center">
            <span className="text-3xl font-semibold tracking-tight tabular-nums">
              72%
            </span>
            <span className="text-xs text-muted-foreground">
              cloud storage used
            </span>
          </div>
        </div>
      </CardContent>
    </Card>
  )
}
```

4. Update the import paths to match your project setup.

### Usage

```tsx
import { RadialChartText } from "@/components/charts/radial-chart-text"
```

```tsx
<RadialChartText />
```

**React Native, SwiftUI, Jetpack Compose**

```tsx title="uniwind/components/charts/radial-chart-text.tsx"
import { View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"

const chartData = [{ name: "value", value: 72 }]

const chartConfig = {
  value: { label: "Used", color: "chart-1" },
} satisfies ChartConfig

export function RadialChartText() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Value in the middle</CardTitle>
        <CardDescription>A single percentage</CardDescription>
      </CardHeader>
      <CardContent>
        <View>
          <View
            pointerEvents="none"
            className="absolute inset-0 items-center justify-center"
          >
            <Text className="text-3xl font-semibold tracking-tight tabular-nums">
              72%
            </Text>
            <Text className="text-xs text-muted-foreground">
              cloud storage used
            </Text>
          </View>
          <ChartContainer
            config={chartConfig}
            accessibilityLabel="Value in the middle"
            className="h-52 w-full"
          >
            <RadialBarChart
              data={chartData}
              innerRadius="72%"
              outerRadius="100%"
              startAngle={90}
              endAngle={-270}
              barSize={16}
            >
              <PolarAngleAxis domain={[0, 100]} />
              <RadialBar
                dataKey="value"
                cornerRadius={20}
                background={{ fillOpacity: 0.22 }}
              />
            </RadialBarChart>
          </ChartContainer>
        </View>
      </CardContent>
    </Card>
  )
}
```

```swift title="swift/Charts/RadialChartText.swift"
import SwiftUI

private let chartConfig: ChartConfig = [
  "value": .init("Used", color: EsuissColor.chart1),
]

public struct RadialChartText: View {
  public init() {}

  public var body: some View {
    Card(.filled, size: .sm) {
      CardHeader("Value in the middle", description: "A single percentage")
      CardContent {
        ChartContainer(config: chartConfig) {
          RadialBarChart(
            [RadialBar("value", value: 72)],
            domain: 0...100,
            innerRadius: 0.72,
            outerRadius: 1,
            barSize: 16,
            startAngle: .degrees(0),
            endAngle: .degrees(360),
            rounded: true,
            track: .tint
          )
          .overlay(alignment: .center) {
            VStack(spacing: 0) {
              Text(verbatim: "72%")
                .textStyle(.xl3, weight: .semibold)
                .monospacedDigit()
              Text("cloud storage used")
                .textStyle(.xs)
                .foregroundStyle(EsuissColor.mutedForeground)
            }
            .multilineTextAlignment(.center)
          }
        }
        .frame(height: 208)
        .accessibilityElement(children: .ignore)
        .accessibilityLabel(Text("Value in the middle"))
        .accessibilityValue(Text("72% cloud storage used"))
      }
    }
  }
}
```

```kt title="kotlin/charts/RadialChartText.kt"
package com.esuiss.ui.charts

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.text.BasicText
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Card
import com.esuiss.ui.components.CardContent
import com.esuiss.ui.components.CardHeader
import com.esuiss.ui.components.CardSize
import com.esuiss.ui.components.CardVariant
import com.esuiss.ui.components.ChartConfig
import com.esuiss.ui.components.ChartConfigItem
import com.esuiss.ui.components.ChartContainer
import com.esuiss.ui.components.RadialBarChart
import com.esuiss.ui.components.chartColor
import com.esuiss.ui.theme.EsuissTheme
import com.esuiss.ui.theme.Typography

private class RadialTextReading(val value: Double)

private val chartData = listOf(RadialTextReading(72.0))

private val chartConfig = ChartConfig(
    "value" to ChartConfigItem("Used") { chart1 },
)

@Composable
fun RadialChartText(modifier: Modifier = Modifier) {
    val colors = EsuissTheme.colors
    Card(modifier, variant = CardVariant.Filled, size = CardSize.Sm) {
        CardHeader("Value in the middle", description = "A single percentage")
        CardContent {
            Box(
                Modifier
                    .fillMaxWidth()
                    .height(208.dp),
            ) {
                ChartContainer(chartConfig, Modifier.matchParentSize()) {
                    val color = chartColor("value")
                    RadialBarChart(
                        chartData,
                        innerRadius = 0.72f,
                        outerRadius = 1f,
                        startAngle = 90f,
                        endAngle = -270f,
                        barSize = 16.dp,
                        accessibilityLabel = "Value in the middle, 72% cloud storage used",
                    ) {
                        PolarAngleAxis(0.0..100.0)
                        RadialBar("value", value = { it.value }, cornerRadius = 20.dp, background = color.copy(alpha = color.alpha * 0.22f))
                    }
                }
                Column(
                    Modifier
                        .align(Alignment.Center)
                        .clearAndSetSemantics {},
                    horizontalAlignment = Alignment.CenterHorizontally,
                ) {
                    BasicText(
                        "72%",
                        style = Typography.xl3.copy(color = colors.foreground, fontWeight = FontWeight.SemiBold, fontFeatureSettings = "tnum"),
                    )
                    BasicText("cloud storage used", style = Typography.xs.copy(color = colors.mutedForeground))
                }
            }
        }
    }
}
```

**React Native, SwiftUI**

A `RadialBarChart` drawn as a full circle, with a single value on a 0 to 100 `PolarAngleAxis` over a tinted track. The percentage and caption are `Text` layered in the middle. Nothing is interactive.

**React Native**

Change the `value` in `chartData` (0 to 100) and the centered text to match it; the label and color live in `chartConfig`. The component takes no props.

**React Native, SwiftUI, Jetpack Compose**

### Installation

**Command**

**React Native**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-text
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-text
```

**SwiftUI**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-text
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-text --platform swift
```

**Jetpack Compose**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-text
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-text --platform kotlin
```

**React Native**

The CLI also adds what it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

**React Native, SwiftUI, Jetpack Compose**

**Manual**

**React Native**

**Uniwind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

2. Copy and paste the following code into `components/charts/radial-chart-text.tsx`:

- `uniwind/components/charts/radial-chart-text.tsx`: shown above

3. Update the import paths to match your project setup.

**NativeWind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

2. Copy and paste the following code into `components/charts/radial-chart-text.tsx`:

```tsx title="nativewind/components/charts/radial-chart-text.tsx"
import { View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"

const chartData = [{ name: "value", value: 72 }]

const chartConfig = {
  value: { label: "Used", color: "chart-1" },
} satisfies ChartConfig

export function RadialChartText() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Value in the middle</CardTitle>
        <CardDescription>A single percentage</CardDescription>
      </CardHeader>
      <CardContent>
        <View>
          <View
            pointerEvents="none"
            className="absolute inset-0 items-center justify-center"
          >
            <Text className="text-3xl font-semibold tracking-tight tabular-nums">
              72%
            </Text>
            <Text className="text-xs text-muted-foreground">
              cloud storage used
            </Text>
          </View>
          <ChartContainer
            config={chartConfig}
            accessibilityLabel="Value in the middle"
            className="h-52 w-full"
          >
            <RadialBarChart
              data={chartData}
              innerRadius="72%"
              outerRadius="100%"
              startAngle={90}
              endAngle={-270}
              barSize={16}
            >
              <PolarAngleAxis domain={[0, 100]} />
              <RadialBar
                dataKey="value"
                cornerRadius={20}
                background={{ fillOpacity: 0.22 }}
              />
            </RadialBarChart>
          </ChartContainer>
        </View>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**StyleSheet**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart), [Text](https://suiss.app/ui/docs/components/text).

2. Copy and paste the following code into `components/charts/radial-chart-text.tsx`:

```tsx title="stylesheet/components/charts/radial-chart-text.tsx"
import { StyleSheet, View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"
import { fontSize, useTheme } from "@/components/ui/theme"

const chartData = [{ name: "value", value: 72 }]

const chartConfig = {
  value: { label: "Used", color: "chart-1" },
} satisfies ChartConfig

const styles = StyleSheet.create({
  overlay: {
    ...StyleSheet.absoluteFill,
    alignItems: "center",
    justifyContent: "center",
  },
  value: {
    ...fontSize["3xl"],
    fontWeight: "600",
    letterSpacing: -0.75,
    fontVariant: ["tabular-nums"],
  },
  caption: { ...fontSize.xs },
  chart: { height: 208 },
})

export function RadialChartText() {
  const { colors } = useTheme()
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Value in the middle</CardTitle>
        <CardDescription>A single percentage</CardDescription>
      </CardHeader>
      <CardContent>
        <View>
          <View pointerEvents="none" style={styles.overlay}>
            <Text style={styles.value}>72%</Text>
            <Text style={[styles.caption, { color: colors.mutedForeground }]}>
              cloud storage used
            </Text>
          </View>
          <ChartContainer
            config={chartConfig}
            accessibilityLabel="Value in the middle"
            style={styles.chart}
          >
            <RadialBarChart
              data={chartData}
              innerRadius="72%"
              outerRadius="100%"
              startAngle={90}
              endAngle={-270}
              barSize={16}
            >
              <PolarAngleAxis domain={[0, 100]} />
              <RadialBar
                dataKey="value"
                cornerRadius={20}
                background={{ fillOpacity: 0.22 }}
              />
            </RadialBarChart>
          </ChartContainer>
        </View>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**SwiftUI**

1. Target iOS 17 or later.

2. Copy the theme files every view uses:

- `swift/Theme/Theme.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Theme.swift)

- `swift/Theme/Tokens.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Tokens.swift)

3. Copy the source and every file it uses:

- `swift/Charts/RadialChartText.swift`: shown above

- `swift/Components/Card.swift`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `swift/Components/Chart.swift`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `swift/Components/Haptics.swift`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `swift/Components/Item.swift`: see [Item](https://suiss.app/ui/docs/components/item.md)

- `swift/Components/Separator.swift`: see [Separator](https://suiss.app/ui/docs/components/separator.md)

4. Add the files to your app target.

**Jetpack Compose**

1. Apply the Compose compiler plugin, enable Compose, set `compileSdk` to 37 or higher and `minSdk` to 24 or higher, and add the dependencies:

```kotlin title="build.gradle.kts"
plugins {
    id("org.jetbrains.kotlin.plugin.compose")
}

android {
    compileSdk = 37
    defaultConfig { minSdk = 24 }
    buildFeatures { compose = true }
}

dependencies {
    implementation(platform("androidx.compose:compose-bom:2026.09.00"))
    implementation("androidx.compose.foundation:foundation")
    implementation("androidx.compose.ui:ui")
}
```

2. Copy the theme files every view uses:

- `kotlin/theme/Theme.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Theme.kt)

- `kotlin/theme/Tokens.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Tokens.kt)

3. Copy the source and every file it uses:

- `kotlin/charts/RadialChartText.kt`: shown above

- `kotlin/components/Card.kt`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `kotlin/components/Chart.kt`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `kotlin/components/Content.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/Content.kt)

- `kotlin/components/FormSupport.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/FormSupport.kt)

- `kotlin/components/Haptics.kt`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `kotlin/components/Icon.kt`: see [Icon](https://suiss.app/ui/docs/components/icon.md)

4. Update the `com.esuiss.ui` package names to match your project.

**React Native, SwiftUI, Jetpack Compose**

### Usage

**React Native**

```tsx
import { RadialChartText } from "@/components/charts/radial-chart-text"
```

```tsx
<RadialChartText />
```

**SwiftUI**

```swift
import SwiftUI

struct RadialTextExample: View {
  var body: some View {
    RadialChartText()
  }
}
```

**Jetpack Compose**

```kotlin
import androidx.compose.runtime.Composable
import com.esuiss.ui.charts.RadialChartText

@Composable
fun RadialTextExample() {
    RadialChartText()
}
```



## Radial Chart Tinted

Concentric radial bars whose unfilled track is a soft tint of each bar's own color.

Source: https://suiss.app/ui/docs/charts/radial-chart#tinted

**React**

**Example**

```tsx title="components/charts/radial-chart-tinted.tsx"
"use client"

import { PolarAngleAxis, RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
} from "@/components/ui/chart"

const MAX = 320

const chartData = [
  { device: "phone", users: 275, fill: "var(--color-phone)" },
  { device: "laptop", users: 200, fill: "var(--color-laptop)" },
  { device: "tablet", users: 187, fill: "var(--color-tablet)" },
  { device: "watch", users: 173, fill: "var(--color-watch)" },
]

const tracks = chartData.map((item) => ({
  ...item,
  users: MAX,
  fill: `color-mix(in oklab, ${item.fill} 22%, transparent)`,
}))

const chartConfig = {
  users: { label: "Users" },
  phone: { label: "Phone", color: "var(--chart-1)" },
  laptop: { label: "Laptop", color: "var(--chart-2)" },
  tablet: { label: "Tablet", color: "var(--chart-3)" },
  watch: { label: "Watch", color: "var(--chart-4)" },
} satisfies ChartConfig

const shape = {
  innerRadius: "25%",
  outerRadius: "100%",
  barSize: 12,
} as const

export function RadialChartTinted() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Tinted track</CardTitle>
        <CardDescription>
          The unfilled part keeps a soft tint of its color
        </CardDescription>
      </CardHeader>
      <CardContent>
        <div className="relative h-52">
          <ChartContainer
            config={chartConfig}
            aria-hidden
            className="absolute inset-0 aspect-auto"
          >
            <RadialBarChart accessibilityLayer={false} data={tracks} {...shape}>
              <PolarAngleAxis
                type="number"
                domain={[0, MAX]}
                tick={false}
                axisLine={false}
              />
              <RadialBar
                dataKey="users"
                cornerRadius={10}
                isAnimationActive={false}
              />
            </RadialBarChart>
          </ChartContainer>
          <ChartContainer
            config={chartConfig}
            className="absolute inset-0 aspect-auto"
          >
            <RadialBarChart accessibilityLayer data={chartData} {...shape}>
              <PolarAngleAxis
                type="number"
                domain={[0, MAX]}
                tick={false}
                axisLine={false}
              />
              <ChartTooltip
                cursor={false}
                content={<ChartTooltipContent hideLabel nameKey="device" />}
              />
              <RadialBar dataKey="users" cornerRadius={10} />
            </RadialBarChart>
          </ChartContainer>
        </div>
      </CardContent>
    </Card>
  )
}
```

Concentric radial bars where the unfilled part of each track is a soft tint of the bar's own color instead of neutral gray. Choose it over the default radial chart for a more colorful look that still shows how far each bar has to go.

Replace `chartData` and add each category to `chartConfig`; the tinted tracks are built from the same data. Set `MAX` to the value that closes a full ring, at or above your largest value. The tracks are a second chart behind the real one, hidden from assistive technology, so change the sizing of both together.

### Installation

**Command**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-tinted
```

Works in any project with a `components.json`. See [Installation](https://suiss.app/ui/docs/installation#add-components) for the one-line registry setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-tinted
```

**Manual**

1. Install the following dependencies:

```bash title="Terminal"
npm install recharts
```

2. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

3. Copy and paste the following code into your project.

```tsx title="components/charts/radial-chart-tinted.tsx"
"use client"

import { PolarAngleAxis, RadialBar, RadialBarChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
} from "@/components/ui/chart"

const MAX = 320

const chartData = [
  { device: "phone", users: 275, fill: "var(--color-phone)" },
  { device: "laptop", users: 200, fill: "var(--color-laptop)" },
  { device: "tablet", users: 187, fill: "var(--color-tablet)" },
  { device: "watch", users: 173, fill: "var(--color-watch)" },
]

const tracks = chartData.map((item) => ({
  ...item,
  users: MAX,
  fill: `color-mix(in oklab, ${item.fill} 22%, transparent)`,
}))

const chartConfig = {
  users: { label: "Users" },
  phone: { label: "Phone", color: "var(--chart-1)" },
  laptop: { label: "Laptop", color: "var(--chart-2)" },
  tablet: { label: "Tablet", color: "var(--chart-3)" },
  watch: { label: "Watch", color: "var(--chart-4)" },
} satisfies ChartConfig

const shape = {
  innerRadius: "25%",
  outerRadius: "100%",
  barSize: 12,
} as const

export function RadialChartTinted() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Tinted track</CardTitle>
        <CardDescription>
          The unfilled part keeps a soft tint of its color
        </CardDescription>
      </CardHeader>
      <CardContent>
        <div className="relative h-52">
          <ChartContainer
            config={chartConfig}
            aria-hidden
            className="absolute inset-0 aspect-auto"
          >
            <RadialBarChart accessibilityLayer={false} data={tracks} {...shape}>
              <PolarAngleAxis
                type="number"
                domain={[0, MAX]}
                tick={false}
                axisLine={false}
              />
              <RadialBar
                dataKey="users"
                cornerRadius={10}
                isAnimationActive={false}
              />
            </RadialBarChart>
          </ChartContainer>
          <ChartContainer
            config={chartConfig}
            className="absolute inset-0 aspect-auto"
          >
            <RadialBarChart accessibilityLayer data={chartData} {...shape}>
              <PolarAngleAxis
                type="number"
                domain={[0, MAX]}
                tick={false}
                axisLine={false}
              />
              <ChartTooltip
                cursor={false}
                content={<ChartTooltipContent hideLabel nameKey="device" />}
              />
              <RadialBar dataKey="users" cornerRadius={10} />
            </RadialBarChart>
          </ChartContainer>
        </div>
      </CardContent>
    </Card>
  )
}
```

4. Update the import paths to match your project setup.

### Usage

```tsx
import { RadialChartTinted } from "@/components/charts/radial-chart-tinted"
```

```tsx
<RadialChartTinted />
```

**React Native, SwiftUI, Jetpack Compose**

```tsx title="uniwind/components/charts/radial-chart-tinted.tsx"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  Cell,
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"

const MAX = 320

const chartConfig = {
  users: { label: "Users" },
  phone: { label: "Phone", color: "chart-1" },
  laptop: { label: "Laptop", color: "chart-2" },
  tablet: { label: "Tablet", color: "chart-3" },
  watch: { label: "Watch", color: "chart-4" },
} satisfies ChartConfig

type Device = "phone" | "laptop" | "tablet" | "watch"

const chartData: { device: Device; users: number }[] = [
  { device: "phone", users: 275 },
  { device: "laptop", users: 200 },
  { device: "tablet", users: 187 },
  { device: "watch", users: 173 },
]

export function RadialChartTinted() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Tinted track</CardTitle>
        <CardDescription>
          The unfilled part keeps a soft tint of its color
        </CardDescription>
      </CardHeader>
      <CardContent>
        <ChartContainer
          config={chartConfig}
          accessibilityLabel="Tinted track"
          className="h-52 w-full"
        >
          <RadialBarChart
            data={chartData}
            innerRadius="25%"
            outerRadius="100%"
            barSize={12}
          >
            <PolarAngleAxis domain={[0, MAX]} />
            <ChartTooltip
              cursor={false}
              content={<ChartTooltipContent hideLabel nameKey="device" />}
            />
            <RadialBar
              isAnimationActive={false}
              dataKey="users"
              cornerRadius={10}
              background={{ fillOpacity: 0.22 }}
            >
              {chartData.map((item) => (
                <Cell key={item.device} fill={chartConfig[item.device].color} />
              ))}
            </RadialBar>
          </RadialBarChart>
        </ChartContainer>
      </CardContent>
    </Card>
  )
}
```

```swift title="swift/Charts/RadialChartTinted.swift"
import SwiftUI

private let chartData: [(device: String, users: Double)] = [
  ("phone", 275), ("laptop", 200), ("tablet", 187), ("watch", 173),
]

private let chartConfig: ChartConfig = [
  "users": .init("Users"),
  "phone": .init("Phone", color: EsuissColor.chart1),
  "laptop": .init("Laptop", color: EsuissColor.chart2),
  "tablet": .init("Tablet", color: EsuissColor.chart3),
  "watch": .init("Watch", color: EsuissColor.chart4),
]

public struct RadialChartTinted: View {
  @State private var selection: Int?

  public init() {}

  public var body: some View {
    Card(.filled, size: .sm) {
      CardHeader("Tinted track", description: "The unfilled part keeps a soft tint of its color")
      CardContent {
        ChartContainer(config: chartConfig) {
          RadialBarChart(
            chartData.map { RadialBar($0.device, value: $0.users) },
            domain: 0...320,
            innerRadius: 0.25,
            outerRadius: 1,
            barSize: 12,
            rounded: true,
            track: .tint,
            selection: $selection,
            accessibilityLabel: "Tinted track",
            isAnimationActive: false
          ) { payload in
            ChartTooltipContent(payload, hideLabel: true)
          }
        }
        .frame(height: 208)
      }
    }
  }
}
```

```kt title="kotlin/charts/RadialChartTinted.kt"
package com.esuiss.ui.charts

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.unit.dp
import com.esuiss.ui.components.Card
import com.esuiss.ui.components.CardContent
import com.esuiss.ui.components.CardHeader
import com.esuiss.ui.components.CardSize
import com.esuiss.ui.components.CardVariant
import com.esuiss.ui.components.ChartCell
import com.esuiss.ui.components.ChartConfig
import com.esuiss.ui.components.ChartConfigItem
import com.esuiss.ui.components.ChartContainer
import com.esuiss.ui.components.ChartTooltipContent
import com.esuiss.ui.components.RadialBarChart
import com.esuiss.ui.components.chartColor

private const val MAX = 320.0

private class RadialTintedDeviceUsers(val device: String, val users: Double)

private val chartData = listOf(
    RadialTintedDeviceUsers("phone", 275.0),
    RadialTintedDeviceUsers("laptop", 200.0),
    RadialTintedDeviceUsers("tablet", 187.0),
    RadialTintedDeviceUsers("watch", 173.0),
)

private val chartConfig = ChartConfig(
    "users" to ChartConfigItem("Users"),
    "phone" to ChartConfigItem("Phone") { chart1 },
    "laptop" to ChartConfigItem("Laptop") { chart2 },
    "tablet" to ChartConfigItem("Tablet") { chart3 },
    "watch" to ChartConfigItem("Watch") { chart4 },
)

@Composable
fun RadialChartTinted(modifier: Modifier = Modifier) {
    Card(modifier, variant = CardVariant.Filled, size = CardSize.Sm) {
        CardHeader("Tinted track", description = "The unfilled part keeps a soft tint of its color")
        CardContent {
            Box(
                Modifier
                    .fillMaxWidth()
                    .height(208.dp),
            ) {
                ChartContainer(
                    chartConfig,
                    Modifier
                        .matchParentSize()
                        .clearAndSetSemantics {},
                ) {
                    val tints = chartData.map { chartColor(it.device).let { color -> color.copy(alpha = color.alpha * 0.22f) } }
                    RadialBarChart(chartData, innerRadius = 0.25f, outerRadius = 1f, barSize = 12.dp) {
                        PolarAngleAxis(0.0..MAX)
                        RadialBar("users", value = { MAX }, nameKey = { it.device }, cornerRadius = 10.dp, cells = { index -> ChartCell(tints[index]) }, isAnimationActive = false)
                    }
                }
                ChartContainer(chartConfig, Modifier.matchParentSize()) {
                    RadialBarChart(
                        chartData,
                        innerRadius = 0.25f,
                        outerRadius = 1f,
                        barSize = 12.dp,
                        accessibilityLabel = "Tinted track",
                    ) {
                        PolarAngleAxis(0.0..MAX)
                        ChartTooltip { ChartTooltipContent(hideLabel = true) }
                        RadialBar("users", value = { it.users }, nameKey = { it.device }, cornerRadius = 10.dp)
                    }
                }
            }
        }
    }
}
```

**React Native**

A `RadialBarChart` with one bar per record in `chartData`, measured against a shared `MAX` of 320. Each bar is colored through `Cell`, and its background track uses the same color at low opacity. Pressing a bar shows a tooltip. The bars set `isAnimationActive={false}` and draw without the enter animation.

Replace `chartData` with your records, set `MAX` to the top of your range, and add a matching entry per item to `chartConfig`. The component takes no props.

**React Native, SwiftUI, Jetpack Compose**

### Installation

**Command**

**React Native**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-tinted
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-tinted
```

**SwiftUI**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-tinted
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-tinted --platform swift
```

**Jetpack Compose**

```bash title="Terminal"
npx shadcn@latest add @esuiss/radial-chart-tinted
```

See [Installation](https://suiss.app/ui/docs/installation) for the `components.json` setup. Or use the [suiss/ui CLI](https://suiss.app/ui/docs/cli):

```bash title="Terminal"
npx @esuiss/ui@latest add charts radial-chart-tinted --platform kotlin
```

**React Native**

The CLI also adds what it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

**React Native, SwiftUI, Jetpack Compose**

**Manual**

**React Native**

**Uniwind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

2. Copy and paste the following code into `components/charts/radial-chart-tinted.tsx`:

- `uniwind/components/charts/radial-chart-tinted.tsx`: shown above

3. Update the import paths to match your project setup.

**NativeWind**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

2. Copy and paste the following code into `components/charts/radial-chart-tinted.tsx`:

```tsx title="nativewind/components/charts/radial-chart-tinted.tsx"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  Cell,
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"

const MAX = 320

const chartConfig = {
  users: { label: "Users" },
  phone: { label: "Phone", color: "chart-1" },
  laptop: { label: "Laptop", color: "chart-2" },
  tablet: { label: "Tablet", color: "chart-3" },
  watch: { label: "Watch", color: "chart-4" },
} satisfies ChartConfig

type Device = "phone" | "laptop" | "tablet" | "watch"

const chartData: { device: Device; users: number }[] = [
  { device: "phone", users: 275 },
  { device: "laptop", users: 200 },
  { device: "tablet", users: 187 },
  { device: "watch", users: 173 },
]

export function RadialChartTinted() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Tinted track</CardTitle>
        <CardDescription>
          The unfilled part keeps a soft tint of its color
        </CardDescription>
      </CardHeader>
      <CardContent>
        <ChartContainer
          config={chartConfig}
          accessibilityLabel="Tinted track"
          className="h-52 w-full"
        >
          <RadialBarChart
            data={chartData}
            innerRadius="25%"
            outerRadius="100%"
            barSize={12}
          >
            <PolarAngleAxis domain={[0, MAX]} />
            <ChartTooltip
              cursor={false}
              content={<ChartTooltipContent hideLabel nameKey="device" />}
            />
            <RadialBar
              isAnimationActive={false}
              dataKey="users"
              cornerRadius={10}
              background={{ fillOpacity: 0.22 }}
            >
              {chartData.map((item) => (
                <Cell key={item.device} fill={chartConfig[item.device].color} />
              ))}
            </RadialBar>
          </RadialBarChart>
        </ChartContainer>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**StyleSheet**

1. Add the pieces it builds on: [Card](https://suiss.app/ui/docs/components/card), [Chart](https://suiss.app/ui/docs/components/chart).

2. Copy and paste the following code into `components/charts/radial-chart-tinted.tsx`:

```tsx title="stylesheet/components/charts/radial-chart-tinted.tsx"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  Cell,
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  PolarAngleAxis,
  RadialBar,
  RadialBarChart,
} from "@/components/ui/chart"

const MAX = 320

const chartConfig = {
  users: { label: "Users" },
  phone: { label: "Phone", color: "chart-1" },
  laptop: { label: "Laptop", color: "chart-2" },
  tablet: { label: "Tablet", color: "chart-3" },
  watch: { label: "Watch", color: "chart-4" },
} satisfies ChartConfig

type Device = "phone" | "laptop" | "tablet" | "watch"

const chartData: { device: Device; users: number }[] = [
  { device: "phone", users: 275 },
  { device: "laptop", users: 200 },
  { device: "tablet", users: 187 },
  { device: "watch", users: 173 },
]

export function RadialChartTinted() {
  return (
    <Card variant="filled" size="sm">
      <CardHeader>
        <CardTitle>Tinted track</CardTitle>
        <CardDescription>
          The unfilled part keeps a soft tint of its color
        </CardDescription>
      </CardHeader>
      <CardContent>
        <ChartContainer
          config={chartConfig}
          accessibilityLabel="Tinted track"
          style={{ height: 208 }}
        >
          <RadialBarChart
            data={chartData}
            innerRadius="25%"
            outerRadius="100%"
            barSize={12}
          >
            <PolarAngleAxis domain={[0, MAX]} />
            <ChartTooltip
              cursor={false}
              content={<ChartTooltipContent hideLabel nameKey="device" />}
            />
            <RadialBar
              isAnimationActive={false}
              dataKey="users"
              cornerRadius={10}
              background={{ fillOpacity: 0.22 }}
            >
              {chartData.map((item) => (
                <Cell key={item.device} fill={chartConfig[item.device].color} />
              ))}
            </RadialBar>
          </RadialBarChart>
        </ChartContainer>
      </CardContent>
    </Card>
  )
}
```

3. Update the import paths to match your project setup.

**SwiftUI**

1. Target iOS 17 or later.

2. Copy the theme files every view uses:

- `swift/Theme/Theme.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Theme.swift)

- `swift/Theme/Tokens.swift`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/swiftui/Sources/EsuissUI/Theme/Tokens.swift)

3. Copy the source and every file it uses:

- `swift/Charts/RadialChartTinted.swift`: shown above

- `swift/Components/Card.swift`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `swift/Components/Chart.swift`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `swift/Components/Haptics.swift`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `swift/Components/Item.swift`: see [Item](https://suiss.app/ui/docs/components/item.md)

- `swift/Components/Separator.swift`: see [Separator](https://suiss.app/ui/docs/components/separator.md)

4. Add the files to your app target.

**Jetpack Compose**

1. Apply the Compose compiler plugin, enable Compose, set `compileSdk` to 37 or higher and `minSdk` to 24 or higher, and add the dependencies:

```kotlin title="build.gradle.kts"
plugins {
    id("org.jetbrains.kotlin.plugin.compose")
}

android {
    compileSdk = 37
    defaultConfig { minSdk = 24 }
    buildFeatures { compose = true }
}

dependencies {
    implementation(platform("androidx.compose:compose-bom:2026.09.00"))
    implementation("androidx.compose.foundation:foundation")
    implementation("androidx.compose.ui:ui")
}
```

2. Copy the theme files every view uses:

- `kotlin/theme/Theme.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Theme.kt)

- `kotlin/theme/Tokens.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/theme/Tokens.kt)

3. Copy the source and every file it uses:

- `kotlin/charts/RadialChartTinted.kt`: shown above

- `kotlin/components/Card.kt`: see [Card](https://suiss.app/ui/docs/components/card.md)

- `kotlin/components/Chart.kt`: see [Chart](https://suiss.app/ui/docs/components/chart.md)

- `kotlin/components/Content.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/Content.kt)

- `kotlin/components/FormSupport.kt`: [source](https://github.com/e-suiss/ui/blob/main/packages/mobile/kotlin/ui/src/main/kotlin/com/esuiss/ui/components/FormSupport.kt)

- `kotlin/components/Haptics.kt`: see [Haptics](https://suiss.app/ui/docs/components/haptics.md)

- `kotlin/components/Icon.kt`: see [Icon](https://suiss.app/ui/docs/components/icon.md)

4. Update the `com.esuiss.ui` package names to match your project.

**React Native, SwiftUI, Jetpack Compose**

### Usage

**React Native**

```tsx
import { RadialChartTinted } from "@/components/charts/radial-chart-tinted"
```

```tsx
<RadialChartTinted />
```

**SwiftUI**

```swift
import SwiftUI

struct RadialTintedExample: View {
  var body: some View {
    RadialChartTinted()
  }
}
```

**Jetpack Compose**

```kotlin
import androidx.compose.runtime.Composable
import com.esuiss.ui.charts.RadialChartTinted

@Composable
fun RadialTintedExample() {
    RadialChartTinted()
}
```

