Slider
Documentation and examples for the Slider component.
When To Use
범위 내의 값을 입력할 때 사용합니다.
Example Usage
astro
<Slider id="slider1" min={0} max={100} value={50} /> Range & Tooltips
Enable range to allow selecting a minimum and maximum value,
and pass an array to value. Adding tooltip will
display the current values when interacting.
astro
<Slider range tooltip value={[20, 80]} label="Price Range" /> Variants & Slots
The Slider supports a tall variant for a thicker track. You
can also customize the handler visual using the thumb slot.
astro
<Slider variant="tall" value={40} label="Brightness">
<div slot="thumb" class="w-8 h-8 bg-white border-2 border-zinc-900 rounded-md flex items-center justify-center shadow-sm">
<Icon name="Sun" class="w-4 h-4 text-zinc-900" />
</div>
</Slider> How to Use
astro
---
import Slider from '@/components/data-entry/Slider.astro';
---
<Slider id="slider1" min={0} max={100} value={50} /> API
| 속성 | 설명 | 타입 | 기본값 |
|---|---|---|---|
| label | 슬라이더에 대한 레이블 | string | |
| variant | 시각적 스타일 변형 | 'default' | 'tall' | 'default' |
| range | 이중 썸 범위 선택을 활성화합니다 | boolean | false |
| value | 현재 값 또는 범위를 위한 두 값의 배열 | number | [number, number] | 50 |
| min | 최소값 | number | 0 |
| max | 최대값 | number | 100 |
| step | 슬라이더의 정밀도 | number | 1 |
| tooltip | 툴팁에 값을 표시합니다 | boolean | false |
| error | Indicates an error state or displays an error message | string | boolean | |
| success | Indicates a success state or displays a success message | string | boolean | |
| disabled | Disables the component | boolean | false |