Slider[x]
represents a slider with setting x in the range 0 to 1.
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[x,{xmin,xmax}]
represents a slider with range xmin to xmax.
Slider[x,{xmin,xmax,dx}]
represents a slider that jumps in steps dx.
Slider[x,{{e1,e2,…}}]
represents a slider in which equally spaced intervals correspond to successive settings ei.
Slider[x,{{{e1,w1},{e2,w2},…}}]
uses intervals of relative widths wi for the ei.
Slider
Slider[x]
represents a slider with setting x in the range 0 to 1.
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[x,{xmin,xmax}]
represents a slider with range xmin to xmax.
Slider[x,{xmin,xmax,dx}]
represents a slider that jumps in steps dx.
Slider[x,{{e1,e2,…}}]
represents a slider in which equally spaced intervals correspond to successive settings ei.
Slider[x,{{{e1,w1},{e2,w2},…}}]
uses intervals of relative widths wi for the ei.
Details and Options
- Slider[…] displays in a notebook as a horizontal slider that can be manipulated interactively.
- Slider[Dynamic[x]] will reset the value of x when the slider is moved; Slider[x] will not.
- Slider[n,{nmin,nmax,dn}] jumps to integer positions if nmin and dn are integers. »
- Slider[x,{xmin,xmax,dx}] in general jumps to positions given by Range[xmin,xmax,dx]. »
- Slider[x] represents a slider running from left to right.
- Slider[x,{xmax,xmin}] with xmax > xmin 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[x,{0,1,dx}] displays at position x, even if this is not a multiple of dx.
- In Slider[x,{{e1,e2,…}}], the ei can be any expressions, not just numbers. »
- The following options can be given:
-
Appearance Automatic the overall appearance of the slider AutoAction False whether to move the slider automatically when the mouse is over it BaselinePosition Automatic alignment relative to surrounding text BaseStyle {} base style specifications for the slider ContinuousAction True whether to update continuously when the slider is moved Enabled Automatic whether the slider is enabled or grayed out Exclusions {} specific values to be excluded ImageMargins 0 margins around the image of the displayed slider ImageSize Automatic the overall image size of the displayed slider - Possible settings for Appearance include Tiny, Small, Medium, and Large, as well as typically some other settings such as "UpArrow" and "DownArrow".
- Appearance->"Labeled" 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 "Slider" style in the current stylesheet.
- Slider[] is equivalent to Slider[0.5].
- The resulting slider can be finely manipulated by holding down the
key (or
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
and/or
keys.
Examples
open all close allBasic Examples (3)
Scope (5)
Use the range
to
, increasing when going from left to right:
x = 0;{Slider[Dynamic[x], {-1, 1}], Dynamic[x]}A slider with range
to
, increasing when going from right to left:
y = 0;{Slider[Dynamic[y], {1, -1}], Dynamic[y]}Use only integer variable values:
{Slider[Dynamic[n], {0, 100, 1}], Dynamic[n]}{Slider[Dynamic[x], {0, 1, 1 / 5}], Dynamic[x]}{Slider[Dynamic[y], {0, 10Pi, Pi}], Dynamic[y]}{Slider[Dynamic[z], {a, 20a, 2a}], Dynamic[z]}Use a list of possible values:
{Slider[Dynamic[x], {{a, 2, True}}], Dynamic[x]}Change the relative width corresponding to each possible value:
{Slider[Dynamic[x], {{{a, 10}, {2, 5}, {True, 20}}}], Dynamic[x]}Options (20)
Appearance (4)
Table[Slider[0.5, Appearance -> a], {a, {Tiny, Small, Medium, Large}}]Slider[0.5, Appearance -> "Labeled"]Special arrow appearances are available on some platforms:
Table[Slider[Appearance -> a], {a, {"UpArrow", "DownArrow"}}]Use dynamic appearance, based on whether Round[x] is
or
:
{Slider[Dynamic[x], Appearance -> Dynamic[If[Round[x] == 1, "UpArrow", "DownArrow"]]], Dynamic[Round[x]]}AutoAction (2)
By default, no slider values change until you click in the slider area:
{Slider[Dynamic[x]], Dynamic[x]}By setting AutoAction, the slider values change as the mouse moves over the slider area:
{Slider[Dynamic[x], AutoAction -> True], Dynamic[x]}Background (2)
BaselinePosition (2)
Align with the surrounding text:
Row[Table[Slider[0.5, ImageSize -> 100, BaselinePosition -> p], {p, {Top, Center, Bottom}}], "xxx"]Dynamically change the baseline position:
{"x", Slider[Dynamic[x], {{Top, Center, Bottom}}, BaselinePosition -> Dynamic[x]], "x"}//RowContinuousAction (2)
By default, variables are continuously updated:
{Slider[Dynamic[x]], Dynamic[x]}Setting ContinuousAction to False makes variables update only when the slider is released:
{Slider[Dynamic[y], ContinuousAction -> False], Dynamic[y]}Enabled (2)
Exclusions (1)
ImageMargins (1)
By setting ImageMargins, you make the slider area larger:
Table[Slider[0.5, ImageMargins -> m, Background -> Pink], {m, {0, 5, 10, 20}}]ImageSize (4)
Column[Table[Slider[0.5, ImageSize -> i], {i, {Tiny, Small, Medium, Large}}]]Column[Table[Slider[0.5, ImageSize -> i], {i, {50, 150, 300, 500}}]]By setting the second element, you can also control the height reserved by the slider:
Slider[0.5, ImageSize -> {Automatic, 50}]Slider[ImageSize -> {400, 50}]Applications (2)
DynamicModule[{n = 1000}, {Slider[Dynamic[n], {1, 10^5, 1}], Subscript[p, Dynamic[n]]⟶Dynamic[Prime[n]]}]Selecting the n
digit in the decimal expansion of π:
DynamicModule[{n = 10000}, {Slider[Dynamic[n], {1, 10^5, 1}], Subscript[π, Dynamic[n]]⟶Dynamic[First@First@RealDigits[Pi, 10, 1, -n]]}]DynamicModule[{red = 0, green = 0, blue = 0},
Column[{Grid[{
{Graphics[{Red, Rectangle[]}, ImageSize -> 30], Slider[Dynamic[red]]}, {Graphics[{Green, Rectangle[]}, ImageSize -> 30], Slider[Dynamic[green]]},
{Graphics[{Blue, Rectangle[]}, ImageSize -> 30], Slider[Dynamic[blue]]}}],
Dynamic[Graphics[{RGBColor[Dynamic[red], Dynamic[green], Dynamic[blue]], Disk[]}]]}]]Possible Issues (1)
Appearances provided by the operating system may be different or unavailable on other platforms:
Slider[0.5, Appearance -> "UpArrow"]Generic appearances are available on all platforms:
Style[Slider[0.5, Appearance -> "UpArrow"], ControlsRendering -> "Generic"]Tech Notes
Related Workflows
- Make Forms with Sliders and Other Controls ▪
- Build a Manipulate
Text
Wolfram Research (2007), Slider, Wolfram Language function, https://reference.wolfram.com/language/ref/Slider.html (updated 2008).
CMS
Wolfram Language. 2007. "Slider." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2008. https://reference.wolfram.com/language/ref/Slider.html.
APA
Wolfram Language. (2007). Slider. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Slider.html
BibTeX
@misc{reference.wolfram_2026_slider, author="Wolfram Research", title="{Slider}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/Slider.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_slider, organization={Wolfram Research}, title={Slider}, year={2008}, url={https://reference.wolfram.com/language/ref/Slider.html}, note=[Accessed: 13-June-2026]}