Slider Component

A Slider uses mouse input to collect ratings, all sliders have the same basic structure (a line, rectangle or series of dots to indicate the range of values, several tick marks and labels, a marker) but their appearance can be varied significantly by changing the style parameter. For example, a radio style Slider features several dots and a circular marker, while a scrollbar style Slider features a translucent rectangle with a long marker like the page scrollbar on a website.



Everything in a PsychoPy® experiment needs a unique name. The name should contain only letters, numbers and underscores (no punctuation marks or spaces).

Start :

The time that the stimulus should first appear. See Defining the onset/duration of components for details.

Stop :

The duration for which the stimulus is presented. See Defining the onset/duration of components for details.

Size(width, height)

The size controls the width and height of the slider. The slider is oriented horizontally when the width is greater than the height, and oriented vertically otherwise. Default is (1.0, 0.1)


The position of the centre of the stimulus, in the units specified by the stimulus or window. Default is centered left-right, and somewhat lower than the vertical center (0, -0.4).

Ticks(list or tuple of integers)

The ticks that will be place on the slider scale. The first and last ticks will be placed on the ends of the slider, and the remaining are spaced between the endpoints corresponding to their values. For example, (1, 2, 3, 4, 5) will create 5 evenly spaced ticks. (1, 3, 5) will create three ticks, one at each end and one in the middle.

Labels(list or tuple of strings)

The text to go with each tick (or spaced evenly across the ticks). If you give 3 labels but 5 tick locations then the end and middle ticks will be given labels. If the labels can’t be distributed across the ticks then an error will be raised. If you want an uneven distribution you should include a list matching the length of ticks but with some values set to None.

Granularity :

Specifies step size for rating. 0 corresponds to a continuous scale, 1 corresponds to an integer or discrete scale.

Force end of Routine :

If checked, when the subject makes a rating the routine will be ended.

Opacityvalue from 0 to 1 or None

Setting the opacity of the Slider will set the opacity of all of its parts to the same value, to control these individually set opacity to None

Units :

See Units for the window and stimuli.

Flip :

By default labels are below the scale or left of the scale. By checking this checkbox, the labels are placed above the scale or to the right of the scale.


Font :

Font for labels.

Letter Height :

Font size for labels,


Label Color :

Color of the labels. See Color spaces.

Marker Color :

Color of the marker. See Color spaces.

Line Color :

Color of the lines or, for styles such as scrollbar or slider, the backboard. See Color spaces.

Styles :

A selection of pre-defined styles.

Style Tweaks :

Tweaks to the style of the slider which can be applied on top of the overall style - multiple tweaks can be selected.

See also

API reference for Slider

Back to top