Menu

React Wheel Picker: iOS Wheels for Times and Dates
📰

React Wheel Picker: iOS Wheels for Times and Dates

DEV Community: react·Serban Dan Rusu·18 days ago
#nFri8c2f
#devtoreact#devto#dev#wheel#picker
Reading 0:00
15s threshold

TL;DR

A React wheel picker that feels native lets the browser do the scrolling: a scroll-snap list brings the phone's own momentum and rubber band, each row is turned on a 3D cylinder from scrollTop in one animation frame, and the value commits once, when the wheel comes to rest. Use wheels for times, durations and birth dates on phones, keep a typed field on desktop, and give mouse drag, the scroll wheel and the keyboard their own paths. Wingo UI's Pro Picker Wheel and Time Picker ship all of this, with a bottom sheet below 768px.

You want a React wheel picker because a phone user should not type 14:30 on a keyboard that covers half the form, and paging a calendar back 36 years to a birth date is worse. The hard part is the feel: the React wheel packages we checked replace the browser's scrolling with their own touch physics.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.