Skip to main content

Slider

A component enabling the user to adjust a value within a specific range by dragging a handle along a track.

Code Example

import { Glass, Slider } from "@coconut-xr/apfel-kruemel";

export default function Checkboxes() {
return (
<Glass borderRadius={32} padding={16} flexDirection="column" gapRow={16}>
<Slider size="sm" defaultValue={5} />
</Glass>
);
}

Sandbox

Params

NameTypeAttributesDescription
valuenumberoptionalThe current value of the slider
defaultValuenumberoptionalThe default value of the slider
onValueChange(value: number) => voidoptionalCallback that is fired when the user changes the slider position
rangenumberoptional / default: 10Min and max value of the slider given as a range (0 to 'range')
sizeSizeoptional / default: "md"Sets the size of the slider. Options are "xs" / "sm" / "md" / "lg"
iconReactNodeoptionalAn icon displayed at the front of the slider
disabledbooleanoptional / default: falseIf true, disable all interactions for the slider