ValyroUI Русская версия

Number Wheel

Number on a spinning wheel with neighboring values. Pro · Animated components › Code and numbers

A number on a turning drum, like a slot counter: neighbours above and below, and a change rolls through the numbers in between on a spring. Every frame is written straight to the DOM; the exact value is always in the accessible text.

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add number-wheel
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { NumberWheel } from 'valyro-ui-pro';

Props

PropTypeDefault
value *numberThe number the wheel comes to rest on.
fromnumberNumber shown before the wheel first turns, e.g. 0 to roll up to value (default: value, no roll).
stepnumber1Difference between neighbouring numbers on the wheel (default 1).
sideItemsnumber2Neighbours shown above and below the current number (default 2).
itemSizenumber35Height of one number, px (default 35).
direction'btt' | 'ttb''btt'btt: higher numbers come up from below (default); ttb: they come down from above.
minnumberNumbers below this stay blank, e.g. 0 for a count.
startOnViewbooleanfalseStart turning only when the wheel scrolls into view (default false).
delaynumber0Pause before turning, ms (default 0).
formatIntl.NumberFormatOptionsIntl.NumberFormat options for every number on the wheel.
localestringLocale for the numbers (default: the ThemeProvider's, then the browser's).

Related components

Previous: Code Tabs · Next: Pin List · All Animated components