Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Manipulation Surface
  3. API and Development

Manipulation Surface

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Import ManipulationSurface, ManipulationSurfaceAxis, ManipulationSurfaceTracking, ManipulationSurfaceType from @prepared911/ui/manipulation-surface.
ExportRole
ManipulationSurfaceThe manipulation surface
ManipulationSurfaceTypeSlider (default), Separator, Surface
ManipulationSurfaceAxisInline (default) or Block
ManipulationSurfaceTrackingRelative (default) or Absolute
ManipulationSurfacePropsProps type for manipulation surfaces
InteractableProps (src/models/interactable.ts) is the separate native-control contract Button and Link extend. A future Interactable component in this package will wrap polymorphic click targets like ui-core's Interactable; it does not replace ManipulationSurface.
Props
PropTypeDefault
typeManipulationSurfaceTypeSlider
axisManipulationSurfaceAxisInline
rolestring, read only for Surfacenone
value, defaultValuenumbernone
min, maxnumber0, 100
step, largeStepnumber1, 10
reversedbooleanfalse
trackingManipulationSurfaceTrackingRelative
trackRefRefObject<HTMLElement | null>parent (Relative), host (Absolute)
pixelsPerStepnumbernone
holdDelaynumber (ms)500
disabledbooleanfalse
onValueChange(value, ChangeDetails<ManipulationSurfaceValueChangeReason>)none
onDraggingChange(dragging, ChangeDetails<ManipulationSurfaceValueChangeReason>)none
onHold(ChangeDetails<ChangeReason.PressHold>)none
renderelement or functiondiv
An accessible name is required: aria-label (LocalizedMessage) or aria-labelledby. style, className, tabIndex, and dir are excluded; role is excluded unless type is Surface. Reasons: Drag, KeyboardStep, DragCancel for values; PressHold for onHold. DragCancel restores the value from when the gesture began and is never cancelable.
Props
NameTypeDefaultDescription
aria-descriptionLocalizedMessage—Extended description for assistive tech.
aria-labelLocalizedMessage—Accessible name.
aria-labelledbystring—Id of the element that names this surface.
aria-placeholderLocalizedMessage—Hint for an empty control.
aria-valuetextLocalizedMessage—Human readable form of the value for assistive technology.
axisManipulationSurfaceAxis—Logical axis the value moves along. Defaults to {@link ManipulationSurfaceAxis.Inline}.
childrenReactNode—Content of the host, such as a thumb.
defaultValuenumber—Initial value when uncontrolled.
disabledboolean—Ignores every gesture and key. The host stays focusable and writes aria-disabled.
holdDelaynumber—Milliseconds a pointer or Enter or Space is held before onHold fires. Defaults to 500.
largeStepnumber—Shift with an arrow, PageUp and PageDown step. Defaults to 10.
maxnumber—Upper bound. Defaults to 100.
minnumber—Lower bound. Defaults to 0.
onDraggingChange((dragging: boolean, details: ChangeDetails<ManipulationSurfaceValueChangeReason>) => void)—Called when a pointer gesture starts (true, reason Drag), ends with the value kept (false, Drag), or is abandoned (false, DragCancel).
onHold((details: ChangeDetails<ChangeReason.PressHold>) => void)—Called once when a pointer or Enter or Space is held for holdDelay. Arms the hold gesture.
onValueChange((value: number, details: ChangeDetails<ManipulationSurfaceValueChangeReason>) => void)—Called for every value change with the next value. Cancel a cancelable change with details.cancel(); DragCancel restores the gesture's start value and is not cancelable.
pixelsPerStepnumber—One step per this many pixels of travel, used in place of the track for a list with fixed row height.
refRef<HTMLElement>—Ref to the rendered host.
renderRenderProp<Record<string, unknown>, StateAttributesInput>—Replaces the default div host.
reversedboolean—When true the value grows toward inline-start or block-start (a vertical slider with its minimum at the bottom).
rolestring—ARIA role. Read only when type is {@link ManipulationSurfaceType.Surface}.
stepnumber—Arrow-key step and the grid pointer travel snaps to. Defaults to 1.
titleLocalizedMessage—Native tooltip; accessibility hint, not visible UI title text.
trackingManipulationSurfaceTracking—How pointer position maps to the value. Defaults to {@link ManipulationSurfaceTracking.Relative}.
trackRefRefObject<HTMLElement | null>—Element whose logical size maps to max - min. Defaults to the host's parent for {@link ManipulationSurfaceTracking.Relative} and to the host for {@link ManipulationSurfaceTracking.Absolute}.
typeManipulationSurfaceType—Semantics of the host. Defaults to {@link ManipulationSurfaceType.Slider}.
valuenumber—Controlled value. Give value or defaultValue to give the surface a value model.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Previous
Manipulation Surface / Usage
Next
Manipulation Surface / Accessibility
On this page
Props
Props
Storybook