StellarUI

<stellar-joystick>

Properties

Preview

Recent events cartesian
No events yet.

Markup

Copy
<stellar-joystick label="Movement joystick">
  <stellar-icon slot="thumb" name="mdi:drag"></stellar-icon>
</stellar-joystick>

API

Complete props, events, slots, and implementation notes for the shipped joystick surface.

Props

PropTypeDefaultNotes
labelstring''
disabledbooleanfalse
modenormal | stickynormal
dead-zonenumber0

Events

EventSourceNotes
before-starthostCancelable. event.detail includes angle, distance, x, and y. angle is normalized from 0 to 1 starting at positive x and increasing counterclockwise.
starthostFires once dragging begins with the current normalized detail payload.
movehostFires continuously during pointer movement.
before-stophostCancelable. In normal mode the detail payload is centered; in sticky mode it is the last position.
stophostFires after the drag ends.

Slots

SlotNotes
thumbOptional content rendered inside the movable thumb, typically a stellar-icon.

Notes

  • The public tag is `stellar-joystick`, a drag-only directional control with normalized `x`/`y` output.
  • `before-start` and `before-stop` are cancelable host events; `start`, `move`, and `stop` include `angle`, `distance`, `x`, and `y` in `event.detail`, with `angle` normalized from `0` to `1` starting at positive x and increasing counterclockwise.
  • `mode="normal"` snaps back to center on release. `sticky` keeps the last position until another drag or a programmatic `reset()`.
  • `dead-zone` clamps small movements back to center before events are emitted.
  • The readonly `--distance` custom property tracks the normalized thumb distance from center for advanced styling.