Controls & Inputs

Spring Slider

탄성 있는 초과 움직임과 스프링 움직임을 가진 슬라이더입니다.

Preview

action control

Spring Slider

drag the stepped handle

-
+

62

Installation

bash
Copied
1pnpm dlx shadcn@latest add https://ryong-blog.vercel.app/r/elastic-slider.json

Code

typescript
Copied
1import { ElasticSlider } from "@/components/elastic-slider"23export default function Example() {4  return <ElasticSlider defaultValue={45} />5}

Props

defaultValue

Type
number
Default
50
Description
Initial slider value.

startingValue

Type
number
Default
0
Description
Minimum value.

maxValue

Type
number
Default
100
Description
Maximum value.

isStepped

Type
boolean
Default
false
Description
Whether to snap to steps.

stepSize

Type
number
Default
1
Description
Value increment when stepped.

leftIcon

Type
React.ReactNode
Default
-
Description
Optional left icon.

rightIcon

Type
React.ReactNode
Default
-
Description
Optional right icon.

Reference

ReactBits Spring Slider