Slider
A custom control that lets users set a number by dragging a handle between a minimum and a maximum.
What it is
The Slider (called Linear Slider in the older form editor) is a custom control for number columns. Instead of typing, the user drags a handle along a track between a minimum and a maximum, and the current value shows beside it. It suits values that are estimates, such as a percentage of completion.
When to use it
Use it when a rough value is enough and a range is obvious, such as a score from 0 to 100. Use the plain Whole number, decimal and float control when users must type an exact figure or paste values. Use the Star rating for 1 to 5 opinions, and the Linear gauge when the value is read only.
Licensing and configuration
No extra licence. In the older form editor you select the column, open the Controls tab, choose Add Control and pick Linear Slider. Microsoft's documentation describes Min, Max and Step properties that you bind to a static value or to another column. Microsoft deprecated several older controls in 2021 and no longer lets you add some of them to new forms. Check that your environment still offers the slider before you plan around it.
Pitfalls
- A slider is hard to use with a keyboard or a screen reader unless the step is sensible. Keep the range small.
- A column with no value looks the same as a column at the minimum in some themes. Check how an empty value renders.
- The control only works on number columns, and the column's own minimum and maximum still apply when saving.
- Dragging on a touch screen is imprecise. Use a number input for exact values.
Try it in the demo
- Open the Accelerator form at the deep link and scroll to the Custom controls section.
- Drag the Slider handle, or focus it and use the arrow keys.
- Watch the Linear gauge below it. It shows the same column, so it follows the slider.
- Save with Ctrl+S to keep the value.