Joystick
Joystick is a two-axis positional input. In its default
circle shape it behaves like a physical stick — the handle rides the rim at full deflection and springs back to centre when released. As a square it becomes an XY pad: each axis clamps on its own so the corners are reachable, and the handle stays where it is left.Both axes are normalized to −1…1.
y is up-positive by default, matching how a gamepad axis reads; pass invertY={false} to follow screen space instead.deadZone zeroes small deflections and rescales what is left, so the value still spans the full range past the threshold rather than jumping to the dead-zone size. step snaps each axis, lockAxis restricts travel to one direction, and showCrosshair adds accent rules that track the handle — the usual XY-pad readout.The gesture runs on the shared
useDragGesture hook, which means a drag that leaves the pad keeps tracking the finger instead of handing the touch back to the page. Arrow keys nudge by keyboardStep on web, Home and Escape recentre, and VoiceOver/TalkBack get increment and decrement actions.Examples
(4)Properties
(45)Playground
Basic
A stick that springs back to centre on release. Drag anywhere on the pad — the gesture keeps tracking even when the finger leaves it.
XY pad
shape="square" clamps each axis independently so the corners are reachable, and the handle holds its position on release — the shape a filter or effect pad wants.Dead zone and steps
deadZone ignores small deflections around centre and rescales the rest, so full travel still reports 1. step snaps each axis onto a grid.Axis lock
lockAxis restricts travel to one direction. A single-axis pad also leaves the perpendicular direction to the page, so vertical scrolling still works over a horizontal control.</>
react-ui-library
100+ accessible, themeable components that work seamlessly across iOS, Android, and Web.
A Platform Blocks product.
Quick Links
Resources