- Accordion
- Alert
- Alert Dialog
- Avatar
- Badge
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Circular Progress
- Collapsible
- Compare Slider
- Dialog
- Dropdown Menu
- Gauge
- Input
- Label
- Marquee
- Navigation Menu
- Number Field
- Pagination
- Popover
- Progress
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Tooltip
Demos
Change weight or height by typing or with the − and + buttons. Every result updates as you go.
- BMI
- 22.9
- Normal weight
- BSA, mosteller
- 1.84 m²
- BSA, du bois
- 1.85 m²
- BSA, haycock
- 1.85 m²
"use client"
import { BodyMeasurements } from "@workspace/ui/tools/body-measurements"
export function BodyMeasurementsDemo() {
return (
<div className="mx-auto flex w-full justify-center">
<BodyMeasurements />
</div>
)
}
Usage
Use body measurements when a result or a dose depends on body size. It shows:
- BMI — Weight in kilograms over height in metres squared, with its WHO category.
- BSA — Body surface area in square metres, by three formulas.
Import it from @workspace/ui/tools/body-measurements.
BMI categories
| BMI | Category |
|---|---|
| Under 18.5 | Underweight |
| 18.5 to under 25 | Normal weight |
| 25 to under 30 | Overweight |
| 30 to under 35 | Obesity class I |
| 35 to under 40 | Obesity class II |
| 40 or more | Obesity class III |
BSA formulas
W is weight in kilograms and H is height in centimetres.
| Formula | BSA (m²) | When to use it |
|---|---|---|
| Mosteller | √(W × H / 3600) | The common default. |
| Du Bois | 0.007184 × W^0.425 × H^0.725 | The historical reference. |
| Haycock | 0.024265 × W^0.5378 × H^0.3964 | Often used in children. |
Notes
- The BMI categories are for adults. Assess children and adolescents with BMI-for-age percentiles instead.
- Weight is in kilograms and height in centimetres.
- Results show a dash until both fields are above zero.
- The reset button goes back to the default weight and height.
Body measurement helpers
The maths is in @workspace/ui/lib/body-measurements, so you can use it without the UI.
bodySurfaceArea uses Mosteller unless you pass "du-bois" or "haycock". bmiCategoryLabels turns a category into text, such as Obesity class I. calculateBodyMeasurements(weight, height) from the component file returns the BMI, its category, and all three BSA values at once, or null when either value is not above zero.
Examples
Custom values
Pass defaultWeight and defaultHeight to start from someone's own measurements.
- BMI
- 22.0
- Normal weight
- BSA, mosteller
- 1.66 m²
- BSA, du bois
- 1.66 m²
- BSA, haycock
- 1.66 m²
"use client"
import { BodyMeasurements } from "@workspace/ui/tools/body-measurements"
export function BodyMeasurementsDefault() {
return (
<div className="mx-auto flex w-full justify-center">
<BodyMeasurements defaultWeight={60} defaultHeight={165} />
</div>
)
}
Child
A 20 kg child, 110 cm tall. Use the Haycock BSA, and read BMI against BMI-for-age percentiles rather than the adult category.
- BMI
- 16.5
- Underweight
- BSA, mosteller
- 0.78 m²
- BSA, du bois
- 0.78 m²
- BSA, haycock
- 0.78 m²
"use client"
import { BodyMeasurements } from "@workspace/ui/tools/body-measurements"
export function BodyMeasurementsChild() {
return (
<div className="mx-auto flex w-full justify-center">
<BodyMeasurements defaultWeight={20} defaultHeight={110} />
</div>
)
}
Props
Unlisted props pass through to the Card that wraps the calculator.
BodyMeasurements
| Prop | Type | Default | Description |
|---|---|---|---|
defaultWeight | number | 70 | Weight in kilograms on first render and after reset. |
defaultHeight | number | 175 | Height in centimetres on first render and after reset. |
onChange | (result: BodyMeasurementsResult or null) => void | — | Called when the result changes. |
className | string | — | Classes merged onto the card. |
BodyMeasurementsResult
| Field | Type | Description |
|---|---|---|
bmi | number | Body mass index. |
category | BmiCategory | WHO category, from underweight to obesity-3. |
bsa | Record<BsaFormula, number> | Body surface area in square metres for mosteller, du-bois, and haycock. |