Share Donut

A gradient donut sweeps around to 38% with competitor shares labeled outside. A free, MIT-licensed Remotion number animation.

Installation
$ pnpm dlx shadcn@latest add @remocn/share-donut

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { ShareDonut } from "@/components/remocn/share-donut";
 
const ShareDonutScene = () => (
  <ShareDonut
    highlight={0}
    segments={[
      { label: "remocn", value: 38 },
      { label: "Kitebase", value: 24 },
      { label: "Lumen", value: 17 },
      { label: "Other", value: 21 },
    ]}
  />
);
 
export const RemotionRoot = () => (
  <Composition
    id="ShareDonut"
    component={ShareDonutScene}
    durationInFrames={280}
    fps={60}
    width={1280}
    height={720}
  />
);

A gradient donut sweeps around one segment after another, then the highlighted slice detaches, the rest dim, and its percentage counts up in the center. Pass segments (label and value) and highlight, the index of the hero slice. Ships dark and light via theme.

Props14

PropTypeDefault
segments
DonutSegment[]DEFAULT_SEGMENTS

Slices of the donut, each with a label and value.

highlight
number0

Index of the hero slice that gets the gradient.

drawLength
number52

Frames for the ring to draw all the way round.

thickness
number12

Ring thickness, in px at 720p.

logo
React.ReactNode—

Replaces the remocn mark.

accent
string"#3B5BFD"

Accent color for the hero element.

ink
string—

Text color; overrides the theme ink.

background
string—

Background fill; pass "transparent" to drop it.

fontFamily
string"DM Sans"

Typeface for the copy. Load the font in your project first.

scale
number1

Size of the foreground around the frame's center; the background stays put.

delay
number0

Frames to hold the first frame before anything moves.

grain
booleantrue

Film grain over the scene.

theme
"dark" | "light""dark"

Dark or light palette.

speed
number1

Playback multiplier.

  • segmentsDonutSegment[]

    Slices of the donut, each with a label and value.

    DefaultDEFAULT_SEGMENTS

  • highlightnumber

    Index of the hero slice that gets the gradient.

    Default0

  • drawLengthnumber

    Frames for the ring to draw all the way round.

    Default52

  • thicknessnumber

    Ring thickness, in px at 720p.

    Default12

  • logoReact.ReactNode

    Replaces the remocn mark.

  • accentstring

    Accent color for the hero element.

    Default"#3B5BFD"

  • inkstring

    Text color; overrides the theme ink.

  • backgroundstring

    Background fill; pass "transparent" to drop it.

  • fontFamilystring

    Typeface for the copy. Load the font in your project first.

    Default"DM Sans"

  • scalenumber

    Size of the foreground around the frame's center; the background stays put.

    Default1

  • delaynumber

    Frames to hold the first frame before anything moves.

    Default0

  • grainboolean

    Film grain over the scene.

    Defaulttrue

  • theme"dark" | "light"

    Dark or light palette.

    Default"dark"

  • speednumber

    Playback multiplier.

    Default1