Castle logo

CASTLE UI

search

Search

K
group_work

Castle UI exports 5 components for RangeSlider:

  • RangeSlider: The wrapper that provides context and functionality for all children.
  • RangeSliderTrack: The empty part of the RangeSlider that shows the track.
  • RangeSliderFilledTrack: The filled part of the RangeSlider.
  • RangeSliderThumb: The handle that's used to change the RangeSlider value.

Usage

Import

import {
RangeSlider,
RangeSliderTrack,
RangeSliderFilledTrack,
RangeSliderThumb,
} from '@passfort/castle'
content_copy

Copy

The RangeSlider is a multi thumb slider used to select a range of related values. A common use-case of this component is a price range picker that allows a user to set the minimum and maximum price.

Example

Note: We recommend adding a aria-label or aria-labelledby prop to provide an accessible label for the RangeSlider.

content_copy

Copy

live example

Discrete RangeSliders

Discrete RangeSliders allow you to snap to predefined sets of values. This can be accomplished using the step prop.

content_copy

Copy

live example

Getting the final value when dragging the slider

Dragging the slider can trigger lots of updates and the user might only be interested in the final result after sliding is complete. You can use onChangeEnd for this.

content_copy

Copy

live example

Changing the RangeSlider orientation

content_copy

Copy

live example

Getting the final value when dragging the slider

Dragging the slider can trigger lots of updates and the user might only be interested in the final result after sliding is complete. You can use onChangeEnd for this.

content_copy

Copy

live example

Contents