This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Slider

Slider[x]
represents a slider with setting x in the range 0 to 1.
Slider[Dynamic[x]]
takes the setting to be the dynamically updated current value of x, with the value of x being reset if the slider is moved.
Slider
represents a slider with range to .
Slider
represents a slider that jumps in steps dx.
Slider
represents a slider in which equally spaced intervals correspond to successive settings .
Slider
uses intervals of relative widths for the .
  • Slider[...] displays in a notebook as a horizontal slider that can be manipulated interactively.
  • Slider jumps to integer positions if and dn are integers. »
  • Slider[x] represents a slider running from left to right.
  • Slider with > represents a slider running from right to left. »
  • If the value of the slider is outside the range given, it will be displayed at one of the ends.
  • Slider displays at position x, even if this is not a multiple of dx.
  • In Slider, the can be any expressions, not just numbers. »
  • The following options can be given:
AppearanceAutomaticthe overall appearance of the slider
AutoActionFalsewhether to move the slider automatically when the mouse is over it
BaselinePositionAutomaticalignment relative to surrounding text
BaseStyle{}base style specifications for the slider
ContinuousActionTruewhether to update continuously when the slider is moved
EnabledAutomaticwhether the slider is enabled, or grayed out
Exclusions{}specific values to be excluded
ImageMargins0margins around the image of the displayed slider
ImageSizeAutomaticthe overall image size of the displayed slider
  • Appearance displays the current value of the slider as an editable label.
  • The settings for BaseStyle are appended to the default style typically given by the style in the current stylesheet.
  • The resulting slider can be finely manipulated by holding down the Alt key (or Option on Macintosh) while dragging the mouse. This causes the slider to move at 1/20 the rate of the mouse. The slider can be even more finely manipulated by also holding the Shift and/or Ctrl keys.
A slider set at in the default range to :
A slider with its value updated dynamically:
A slider with integer values in the range to :
A slider set at in the default range to :
In[1]:=
Click for copyable input
Out[1]=
 
A slider with its value updated dynamically:
In[1]:=
Click for copyable input
Out[1]=
 
A slider with integer values in the range to :
In[1]:=
Click for copyable input
Out[1]=
Use the range to , increasing when going from left to right:
A slider with range to , increasing when going from right to left:
Use only integer variable values:
Use rational steps:
Use slider increments of :
Use a symbolic range:
Use a list of possible values:
Change the relative width corresponding to each possible value:
Different sizes:
Add a label:
Special arrow appearances:
Use dynamic appearance, based on whether Round[x] is or :
By default, no slider values change until you click in the slider area:
By setting AutoAction, the slider values change as the mouse moves over the slider area:
Change the background colors:
Change the background color dynamically:
Align with the surrounding text:
Dynamically change the baseline position:
By default, variables are continuously updated:
Setting ContinuousAction to False makes variables update only when the slider is released:
By default, Slider is enabled:
By setting Enabled->False, the slider is disabled but visible in its current state:
Exclude values from the range:
By setting ImageMargins you make the slider area larger:
Use preset values:
Or use any values:
By setting the second element you can also control the height reserved by the slider:
A fully custom image size:
Selecting the n^(th) prime:
Selecting the n^(th) digit in the decimal expansion of :
A color selector:
Randomly sized sliders:
New in 6