BMI Card

An animated circular BMI gauge with configurable shape, thresholds, and color coding. Supports circle, semicircle, and arc layouts.

Demo

24Your BMI

Balanced

You're in a healthy range.

Target reached!
This treatment may not be for you.

Installation

pnpm dlx shadcn@latest add @turbopills-ui/bmi-card

Usage

tsx
1import { BMICard } from "@/components/turbopills/blocks/bmi-card"
tsx
1<BMICard bmi={24} />

Examples

Semicircle

28Your BMI

High Risk

Excess weight may be affecting your health.

You may be eligible for treatment & promotional offers.

Arc

22Your BMI

Balanced

You're in a healthy range.

Target reached!
This treatment may not be for you.

Full Fill Mode

The entire track is filled with the threshold color when fillMode="full".

26Your BMI

At Risk

You're approaching an unhealthy range.

You may be eligible for treatment & promotional offers.

Value Outside

Display the BMI value next to the gauge instead of centered inside.

High Risk

Excess weight may be affecting your health.

Your BMI29
You may be eligible for treatment & promotional offers.

Props

PropTypeDefaultDescription
bminumberRequired. The BMI value to display.
shape"circle" | "semicircle" | "arc""circle"Shape of the gauge.
sizenumber132Width and height of the SVG in pixels.
strokeWidthnumber10Thickness of the progress ring.
minValuenumber5Minimum BMI for the scale range.
maxValuenumber30Maximum BMI for the scale range.
fillMode"full" | "progress""progress""progress" fills proportionally; "full" fills the entire track.
valuePosition"inside" | "outside""inside"Where to render the numeric BMI value.
showThresholdMarkersbooleantrueShow tick marks at threshold boundaries.
showStatusMessagebooleantrueShow the status message below the gauge.
animatedbooleantrueAnimate the progress ring on mount/change.
animationDurationnumber800Animation duration in milliseconds.
labelstring"Your BMI"Label displayed below the value.
tooltipContentReactNodeeligibility textContent for the info tooltip. Pass null to hide.
thresholdsBMIThreshold[]DEFAULT_BMI_THRESHOLDSCustom threshold configuration array.
classNamestringAdditional CSS classes for the wrapper.

BMIThreshold

PropertyTypeDescription
maxBminumberUpper bound of this BMI range (Infinity for the last).
isTargetRangeboolean?Marks this range as the healthy target.
titlestringDisplay title (e.g. "Balanced").
descriptionstringShort description shown next to the gauge.
colorstring | [string, string]Solid color or gradient [start, end].
statusMessage{ text: string; className: string }?Optional banner shown below the gauge.