Skip to main content

SliderProps

Props for Slider.

This is an interface exported by @mapcairn/map, checked against version 0.2.0.

Signature​

import type { SliderProps } from "@mapcairn/map";

interface SliderProps

Properties​

"data-testid"​

readonly "data-testid"?: string;

Applied to the outer wrapper. The value readout gets the same id with a -value suffix and the track a -track suffix.

className​

readonly className?: string;

Applied to the outer wrapper.

disabled​

readonly disabled?: boolean;

Stops the slider from changing and dims it.

formatValue​

readonly formatValue: (value: number) => string;

Turns a value into the text shown beside the label and announced as the slider's aria-valuetext. For example, a percentage slider returns "60%" for 60.

label​

readonly label: string;

The visible label. Required: the slider is named by it.

max​

readonly max: number;

Highest value.

min​

readonly min: number;

Lowest value.

onValueChange​

readonly onValueChange: (value: number) => void;

Called with the next value as the user drags or presses keys.

step​

readonly step: number;

Distance between allowed values. Arrow keys move by one step.

value​

readonly value: number;

The current value. The component is controlled.

Source: packages/map/src/ui/Slider/Slider.tsx:9