Components/Slider
Since 1.0.0BETA

Slider

Range input with value display and optional elastic tooltip feedback.

This page was migrated by AI, please review carefully

Migration is complete, but please validate against source code and manual review.

Slider

Range input with value display and optional elastic tooltip feedback.

Basic Usage

Slider

Interactive preview paused.

Disabled

Slider (disabled)

Interactive preview paused.

Formatted Display

Slider (formatValue)

Interactive preview paused.

Show Values

Slider (show value)

Interactive preview paused.

Elastic Tooltip (speed + acceleration)

Slider (elastic tooltip)

Interactive preview paused.

API

Props

PropTypeDefaultDescription
modelValuenumber0Current slider value. The rendered input clamps it to the min..max range.
minnumber0Minimum range value forwarded to the native range input.
maxnumber100Maximum range value forwarded to the native range input.
stepnumber1Step size forwarded to the native range input.
disabledbooleanfalseDisables the native range input and suppresses tooltip display.
showValuebooleanfalseRenders the formatted current value beside the slider.
formatValue(value: number) => string-Formats the visible side value; also feeds tooltip text when tooltipFormatter is absent.
showTooltipbooleantrueEnables tooltip rendering when the trigger condition is met.
tooltipTrigger'drag' | 'hover' | 'always''drag'Controls when the tooltip is visible: while dragging, on hover/drag, or always.
tooltipFormatter(value: number) => string-Formats tooltip text independently from formatValue.
tooltipPlacement'top' | 'bottom''top'Places the tooltip above or below the thumb.
tooltipTiltbooleanfalseEnables velocity-based tooltip follow, tilt, offset, squash, and skew motion.
tooltipTiltMaxDegnumber18Maximum tilt angle used by the velocity response.
tooltipOffsetMaxPxnumber28Maximum horizontal tooltip offset used by the velocity response.
tooltipAccelBoostnumber0.65Multiplier for acceleration contribution when calculating elastic tooltip intensity.
tooltipSpringStiffnessnumber320Spring stiffness for tooltip follow, offset, and tilt interpolation.
tooltipSpringDampingnumber24Spring damping for tooltip follow, offset, and tilt interpolation.
tooltipMotion'blur' | 'fade' | 'none''blur'Tooltip enter/leave motion. none renders without the transition wrapper.
tooltipMotionDurationnumber160Tooltip enter/leave duration in ms; negative values are clamped to 0ms.
tooltipMotionBlurPxnumber10Blur radius for the blur tooltip motion; negative values are clamped to 0px.
tooltipDistortSkewDegnumber8Maximum skew used by tooltip distortion while moving.
tooltipJellybooleantrueEnables acceleration-triggered wobble on top of the tilt motion.
tooltipJellyFrequencynumber8.5Wobble frequency in hertz.
tooltipJellyDecaynumber10Wobble decay rate; larger values settle faster.
tooltipJellyRotateDegnumber10Maximum wobble rotation contribution.
tooltipJellySkewDegnumber12Maximum wobble skew contribution.
tooltipJellySquashnumber0.16Maximum wobble squash contribution.
tooltipJellyTriggerAccelnumber2800Acceleration threshold used to kick jelly wobble.

Events

EventParamsDescription
update:modelValuenumberEmitted on native input with the next clamped value.
changenumberEmitted on native change with the input's current numeric value.

Interaction Contract

  • The rendered native range input clamps modelValue into the min..max range.
  • Native input emits update:modelValue with the clamped value; native change emits change.
  • disabled blocks value updates and suppresses tooltip rendering.
  • formatValue controls the visible side value and is also used for tooltip text when tooltipFormatter is absent.
  • Tooltip visibility follows tooltipTrigger: drag, hover, or always; showTooltip=false disables it.
  • Negative tooltipMotionDuration and tooltipMotionBlurPx values are clamped to 0ms and 0px.
  • Global pointer listeners are cleaned up on unmount.