enes

Slider

La documentación de Slider estará disponible pronto.

]

Usage

<script>
	import { Slider } from 'fluentui-svelte';
</script>

<Slider value={50} min={0} max={100} />

Range and Step

Use the min, max, and step props to control the range of values and the increment between them.

]

Ticks

Provide an array of values to the ticks prop to render tick marks along the track. Use tickPlacement to position them around, before, or after the rail.

]

Vertical Orientation

Set orientation="vertical" to lay the slider out vertically.

]

Disabled

Set the disabled prop to prevent interaction with the slider.

Component Props

NameTypeDescription
valuenumberThe current value of the slider. Bindable. Default: 0.
minnumberThe minimum value of the range. Default: 0.
maxnumberThe maximum value of the range. Default: 100.
stepnumberThe increment between selectable values. Default: 1.
ticksnumber[]An array of values at which to render tick marks. Default: [].
tickPlacement'around' | 'before' | 'after'Where tick marks are placed relative to the rail. Default: around.
prefixstringText prepended to the value shown in the tooltip. Default: ''.
suffixstringText appended to the value shown in the tooltip. Default: ''.
trackbooleanWhether the filled track is shown. Default: true.
orientation'horizontal' | 'vertical'The layout direction of the slider. Default: horizontal.
reversebooleanReverses the direction of the slider. Default: false.
disabledbooleanWhether the slider is disabled. Default: false.
syncbooleanSnaps the initial value to the nearest step on initialization.
tooltipbooleanWhether the value tooltip is shown while interacting. Default: true.
tooltipPlacementPlacementThe placement of the tooltip relative to the thumb. Default: top.
tooltipContentstring | Snippet | ComponentCustom content for the tooltip. Defaults to prefix + value + suffix.
onChange(value: number) => voidCallback fired when the value changes.
classstringAdditional CSS classes applied to the slider.
refHTMLElementThe DOM reference of the slider element. Bindable.