A joystick selects a normalized two-axis vector with pointer or keyboard input. Applications own physical units, coordinate frames, input shaping, publishing cadence, recording clocks, command-outcome feedback, and alternative controls when needed.
Give each joystick an accessible name with a label, aria-label, or aria-labelledby. Editable controls use the application role to receive two-axis keyboard input. The default accessible description includes both normalized coordinates, keyboard instructions, and release behavior. A locked axis stays at zero; an absent value reads "No position." Disabled and read-only controls omit instructions. Coordinates use up to six decimal places and the document language for number formatting. An explicit aria-description or aria-describedby replaces the default focus description through standard ARIA precedence; it does not disable live announcements.
Both axes use normalized values from -1 to 1. Applications can derive length with Math.hypot(x, y) and angle with Math.atan2(-y, x). This angle uses radians from the rightward direction with counterclockwise positive rotation. Use undefined at neutral. Keep these derived quantities outside the writable value. The angle does not describe the robot's heading.
Constrains the movement region or selects one axis. Circle limits vector magnitude to one;square permits both axes at full scale and a magnitude of up to Math.SQRT2.With equally scaled planar velocity axes, square corners allow about 41% greater speed.Mixed forward-velocity and turning-rate axes have no common physical magnitude.Changing the constraint projects the current value silently and cancels an active interaction.
Circle bounds normalized magnitude to one. Square allows independent full-scale axes and a magnitude of up to Math.SQRT2. Use circle for planar direction and intensity, or square for independent limits such as forward velocity and turning rate. Equally scaled planar velocity axes can produce about 41% greater diagonal speed with square input.
Controls the visual scale of an element to match its importance and available space.
SizeDescriptionsmCompact size for dense layouts or secondary elements with less visual prominence.mdStandard size that works well in most contexts and provides balanced visibility.lgLarger size for emphasizing important elements or improving touch targets in spacious layouts.
Choose small, medium, or large controls to fit the available space. Each size scales the movement surface and thumb together.
Input maps to ROS body axes: x-forward, y-left, z-up, with positive yaw counterclockwise. Travel uses square constraints for independent axis limits; use circle to bound normalized translation magnitude. The illustrative maxima are 1 m/s forward, 0.5 m/s lateral, and 1 rad/s yaw. Each control's :state(active) CSS custom state gates its displayed velocity. Interaction events refresh the readouts. The application chooses its limits and publishes the latest command at its own cadence, including while input remains stationary.
A dead zone of zero and response exponent of one leave circular input unchanged. The dead zone makes neutral easier to select; a larger exponent provides finer control near neutral. The remaining range scales back to full output at the boundary and preserves direction. Shaping produces a separate command vector without rewriting .value. Map it to physical units afterward. Apply filtering in one input layer to avoid processing hardware or recorded samples twice. ROS joystick parameters
Determines whether normal release returns to center or holds the final vector.Interrupted interactions return to neutral in either mode. Form reset restores the declared default instead.
ReleaseDescriptioncenterhold
Keep the last position after release for persistent target selection. Press Escape during an interaction to return to center.
Set readOnly to true before assigning recorded vectors through .value. Use undefined for an absent sample and a zero vector for recorded neutral input. The recording layer captures source, sample time, engagement transitions, and mapping configuration. Preserve its clock during replay and avoid applying input shaping to recorded samples again.
Controls automatic position announcements. Focused user input produces polite announcements at most every 500 ms.A quick tap in center mode reports the input coordinates and the return to center.Escape announces the resulting coordinates without a separate cancellation message.Programmatic writes and read-only playback update the description without live announcements.Set off when the application supplies spoken output, the position description on focus remains available.
AnnounceDescriptionpoliteoff
Supply application announcements with a labeled output. Disable built-in announcements to avoid duplicate feedback.
<div id="joystick-external-feedback" nve-layout="column gap:md">
<nve-joystick aria-label="Target" announce="off" release="hold"></nve-joystick>
<output aria-live="polite" aria-atomic="true">Target: X 0, Y 0</output>
</div>
<script type="module">
const root = document.querySelector("#joystick-external-feedback");
const joystick = root.querySelector("nve-joystick");
const output = root.querySelector("output");
joystick.addEventListener("change", () => {
const value = joystick.value;
output.textContent = value ? "Target: X " + value.x + ", Y " + value.y : "No target";
});
</script>
Internationalization
Enables updating internal string values for internationalization.
Override joystickPosition through i18n to localize spoken coordinates while keeping built-in position announcements.
All elements and features go through 3 phases of stability, pre-release, beta and stable.
pre-release
Docs PreviewAPI DocumentationFully Themeable
beta
Robust unit test coveragesPassed API ReviewPassed Designer VQA ReviewIncluded in library package
stable
No known outstanding AA WCAG issuesNo known outstanding performance issuesAdapts to different screen/container sizesNo breaking API changes for at least 90 days