Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Buttons

  • Button
  • ShimmerButton
  • InteractiveHoverButton
  • RainbowButton
  • PulsatingButton
  • RippleButton
  • ButtonGroup
  • SocialButton

Basic Inputs

  • Input
  • Textarea
  • CellEditor
  • Select
  • Checkbox
  • CheckboxGroup
  • Radio
  • Switch
  • Toggle
  • Segmented
  • Slider
  • NumberField
  • ElasticSlider

Advanced Inputs

  • MathTextarea
  • QuestionEditor
  • QuestionAnswer
  • MathField
  • SecretField
  • PasswordGenerator
  • Combobox
  • RemoteSelect
  • Listbox
  • Mentions
  • InputOTP
  • Rating
  • Upload
  • RegionSelect
  • ImageCropper
  • ScopeMatrix
  • Transfer
  • Cascader
  • TreeSelect
  • RegionCascader
  • CountrySelect
  • MarkdownEditor
  • Novel editor
  • RichTextEditor
  • CodeEditor
  • IssueReporter
  • ColorPicker
  • ColorField
  • ColorSwatchPicker
  • Choicebox
  • EmojiPicker
  • VoiceRecord
  • IconPicker
  • InspectorPanel

Date and Time

  • Calendar
  • DatePicker
  • DateTimePicker
  • DateRangePicker
  • TimePicker
  • TimeField

Form Frameworks

  • Form
  • ModalForm / DrawerForm
  • ProForm
  • StepsForm
  • LoginForm
  • AuthPanel
  • ClickCaptcha
  • Label
  • Field
  • SearchForm

ElasticSlider

elastic-slider

Adds elastic track deformation and spring feedback to a numeric slider.

Usage

Basic usage

The default volume slider, when dragged to both ends, the track will stretch and rebound like a rubber band.

40

tsx
<ElasticSlider defaultValue={40} />

Custom icon

Replace the icons at both ends with leftIcon / rightIcon, such as brightness adjustment.

65

tsx
<ElasticSlider
  defaultValue={65}
  leftIcon={<SunDim className="size-5" aria-hidden />}
  rightIcon={<Sun className="size-5" aria-hidden />}
/>

Step size adsorption

After turning on isStepped, drag and press stepSize to round and adsorb.

30

tsx
<ElasticSlider defaultValue={30} isStepped stepSize={10} />

Customized range

startingValue / maxValue sets the upper and lower bounds, and showValue can hide the value.

tsx
<ElasticSlider
  defaultValue={0}
  startingValue={-50}
  maxValue={50}
  showValue={false}
/>

When to use

Use ElasticSlider for an expressive, pointer-driven value such as volume or brightness. Use the standard Slider when the value belongs in a validated form, requires complete keyboard semantics, or must align with Input and Select controls. ElasticSlider is an uncontrolled presentation component that prioritizes drag feedback over form semantics.

Import

ts
import { ElasticSlider } from "@hulianui/ui"

Props

NameTypeDefaultDescription
defaultValuenumber50Initial value. Internal state is initialized on mount and resynchronized if this prop changes.
startingValuenumber0Value at the left end of the track.
maxValuenumber100Value at the right end of the track.
isSteppedbooleanfalseSnaps dragged values to stepSize increments.
stepSizenumber1Snap increment when isStepped is true.
showValuebooleantrueShows the current numeric value above the center of the track.
classNamestring-Additional class name for the root container.
styleCSSProperties-Inline styles for the root container.

Events

EventTypeDescription
onValueChange(value: number) => voidCalled with each new value produced while dragging.

Slots

SlotTypeDescription
leftIconReactNodeIcon at the lower-value end; it shifts and scales during left-side overdrag.
rightIconReactNodeIcon at the higher-value end; it shifts and scales during right-side overdrag.

Usage guidelines

  • Uncontrolled: defaultValue initializes internal state and resynchronizes when the prop changes. Persist onValueChange results if the application needs to read the current value elsewhere.
  • Overdrag stretches beyond the track in both axes. Leave overflow space around the component and avoid clipping it with overflow-hidden.

Related

Input · Textarea · Select · Checkbox · CheckboxGroup · Radio

Playground

50

<ElasticSlider
  defaultValue={50}
  startingValue={0}
  maxValue={100}
  isStepped={false}
  stepSize={10}
  showValue={true}
/>
PreviousSearchFormFormsNextQuestionCard

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Events
    • Slots
    • Usage guidelines
    • Related
  • Playground