SwipeUI

Weight picker

A bathroom-scale dial you turn under a fixed needle to set a weight, with a large rolling value, a kilograms or pounds switch and a straight tape shape for tight rows.

npx @swipeui/cli add weight-picker
Variant
Preset
Material
Scheme
Feel
Interactive web demo. Native materials, gestures and system presentation differ on device.

When to use it

  • Asking for a body weight in onboarding, a health profile or a daily weigh-in.
  • Any weight a person reads off a scale faster than they type it.

When not to use it

  • A count or a quantity: use Number field or Stepper.
  • A height or a length: use Height picker.

Installation

Installs with a Pro licence

Everything on this page is public except the source. Founder pre-sale opens around 5 January 2027.

Usage

import { WeightPicker } from '@/components/swipeui/special/weight-picker';

<WeightPicker defaultValue={72.4} onValueCommit={(kg) => saveWeight(kg)} />;

The value is always kilograms. The unit switch changes what is shown, never what is stored, so switching back and forth can't drift.

Examples

  • Onboarding: the dial with the value inside it and the unit switch below.
  • Units: start in pounds with defaultUnit="lb".
  • Log: shape="flat" puts a straight tape in a card, with the value and the switch above it.

Weight picker settings

PropDoesDefault
value, defaultValueThe weight in kilograms70
onValueChangeEvery new step while the dial moves—
onValueCommitOnce, when the dial settles—
unit, defaultUnitkg or lbkg
onUnitChangeThe switch was used—
unitSwitchShow the unit switchtrue
min, maxThe range in kilograms30, 200
precisionThe step in the unit shown: 0.1, 0.5 or 10.1
shapearc (a dial) or flat (a tape)arc
needleShow the needletrue
wobbleSwing the needle once as the dial landstrue
dialSpanDegrees of the rim shown, 40 to 160100
fillAccent ticks below the valuetrue
readoutThe large rolling valuetrue
momentumCarry on after a flick and land on a steptrue
rubberBandStretch past the endstrue
fineScrubSlow down by moving the finger down or uptrue
tickSpacingPoints between ticks along the rim8 (10 with whole units)
formatValueReplaces the readout text—
labelThe spoken nameWeight
localeThe locale for the digitsDevice
disabledShow without changingfalse
hapticsA switch, or { tick, major, limit, unit, land }true
messagesBuilt-in stringsEnglish
motionLocal motion feelApp feel

Composition and behavior

Drag the dial sideways and the value under the needle changes, with a tick on each step and a light tap at every major tick. A flick carries on and lands on a step; as it lands the needle swings once and a soft tap lands with it. Past the lightest and heaviest weights the dial stretches, then springs back. While dragging, move your finger down or up to slow the dial to half, quarter and eighth speed.

Screen readers get one adjustable element named Weight, with a value such as "72.4 kilograms" or "159.6 pounds"; swipe up or down to step. With Reduce Motion the dial still follows the finger and then lands at once, without the swing.

The dial pans sideways, so it can sit on a screen that scrolls vertically; wrap the app in GestureHandlerRootView. The dial keeps its left and right in right-to-left layouts, while the flat tape reverses. Only the ticks near the value are mounted, so tenths cost the same as whole units. The public demonstration is written separately for the browser.

Behavior and gestures

  • Drag the dial sideways: the value under the needle changes with a tick per step and a tap at every major tick.
  • Flick it and it carries on, then lands on a step; the needle swings once and a soft tap lands with it. The ends stretch and spring back.
  • Move the finger down or up while dragging to slow the dial to half, quarter and eighth speed.
  • The switch shows kilograms or pounds. The stored weight is always kilograms, so switching never changes it.

Accessibility

  • The dial is one adjustable element named Weight, with a spoken value such as 72.4 kilograms or 159.6 pounds; swipe up and down to step.
  • The ticks, the needle and the large readout are hidden from screen readers; fine-scrub rate changes are announced.
  • The unit switch is a named group of two tabs.

Motion

  • Uses the drag, number and select motion roles, so it follows your app's feel. Pass motion to tune this one instance.
  • The dial follows the finger and glides to a projected step on the drag role, with overshoot clamped; the needle swings out and back on the same role.
  • The readout rolls on the number role; the unit switch's highlight glides on the select role.
  • Reduce Motion: the dial still follows the finger, then lands at once with no needle swing; the landing tap stays.

Performance

  • Only the ticks near the value are mounted, so tenths from 30 to 200 kilograms cost the same as whole units.
  • The dial turns on the UI thread with one rotation; React hears about a new value once per step.

Notes for AI

  • value, min and max are always kilograms. Use onValueCommit to save and onValueChange for live previews.
  • Wrap the screen in GestureHandlerRootView. The dial pans sideways, so it can sit on a vertically scrolling screen.
  • precision is 0.1, 0.5 or 1 in the unit shown. shape="flat" fits a form row.

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items