Skip to content

Half Donut

A segmented half ring for a budget or a quota.

$149 once · every Pro piece

Customize

Categories fill equal segments from left to right in the grey ladder, and what is left of the limit is hatched: hatch means remaining. On mount the segments ignite one after another, each flaring in the accent and cooling to its tone, while the centre number counts up with them. Point at a segment, or Tab in and use the arrow keys: its category runs hot, the others step back and the centre rolls to its amount and share; the hatched part reports what is left. An optional target tick sits outside the ring, and the legend is linked both ways.

Install

npx shadcn@latest add @obsyde/half-donut

Needs your licence key · Get Pro

Usage

Import it from where the CLI puts it, or copy the files below by hand.

import { HalfDonut } from '@/components/obsyde/ember/half-donut/HalfDonut';

export function Example() {
  return (
    <HalfDonut segments={24} />
  );
}

Files

What you get with Pro: plain React, TypeScript and CSS, with no dependencies.

  • ember/half-donut/HalfDonut.tsxcomponent
  • ember/half-donut/half-donut.cssstyles
  • ember/half-donut/HalfDonutDemo.tsxdemo
  • ember/viz-kit/viz-kit.cssshared
  • ember/viz-kit/Tooltip.tsxshared
  • ember/viz-kit/focus.tsshared
  • ember/viz-kit/patterns.tsxshared
  • ember/viz-kit/roll.tsshared
  • ember/shared/rolling-number.cssshared
  • ember/shared/spring.tsshared
  • ember/shared/accent.tsshared
  • ember/viz-kit/scale.tsshared
  • ember/viz-kit/motion.tsshared
  • ember/viz-kit/chart.tsxshared
  • ember/shared/ember.cssshared
  • ember/viz-kit/touch.tsshared
  • ember/viz-kit/keyboard.tsshared
  • ember/viz-kit/size.tsshared
  • ember/viz-kit/state-messages.tsxshared
  • ember/viz-kit/stage.tsxshared
  • ember/viz-kit/stage.cssshared
  • ember/viz-kit/shape.tsshared
  • ember/viz-kit/Legend.tsxshared
  • ember/viz-kit/demo.tsxshared
  • ember/viz-kit/demo.cssshared

API

PropTypeDefault
accentAccent'ember' | 'volt' | 'arc''ember'
presetData'budget' | 'storage''budget'
segmentsSegmentsnumber24
thicknessThicknessnumber0.28
usedUsednumber0.68
targetTargetnumber0
patternPattern'none' | 'diagonal-up' | 'diagonal-down' | 'dots' | 'vertical' | 'crosshatch''diagonal-up'
legendLegend'row' | 'list' | 'none''row'
tooltipTooltip'panel' | 'none''none'
statusStatus'ready' | 'loading' | 'empty''ready'
seedSeednumber2