Back to Fluentui

Slider Migration

packages/react-components/react-slider/library/docs/MIGRATION.md

4.40.2-hotfix22.6 KB
Original Source

Slider Migration

The Slider control is a thin wrapper around an <input type="range"/>. Additional elements like labels and current value will need to be explicitly rendered.

Migration from v8

  • ariaLabel => use aria-label instead
  • ariaValueText => explicitely set aria-valuetext
  • buttonProps => Slider props, other than className and id, are passed to input element
  • componentRef => use ref instead.
  • inline => use css, or wrap in flex parent
  • label => Use Label control with htmlFor and id
  • onChanged => use onChange and onMouse events
  • origin => no longer supported
  • originFromZero => no longer supported
  • ranged, defaultLowerValue and lowerValue => Not supported. Multi value slider will be future work in separate control.
  • showValue and valueFormat => use explicitly rendered value instead
  • snapToStep => use step instead
  • styles => pass classNames to individual slots
  • theme => use FluentProvider HOC instead

Migration from v0

  • accessibility => use aria-* properties directly on Slider
  • fluid => use css, or wrap in flex parent
  • getA11yValueMessageOnChange => explicitely set aria-value-text
  • input => Slider props, other than className and id, are passed to input element
  • inputRef => ref
  • label => use explicitly rendered value instead

Property mapping

v8 Sliderv0 Sliderv9 Slider
accessibility
ariaLabelaria-labelaria-label
ariaValueTextaria-valuetextaria-valuetext
buttonProps
componentRefinputRefref
defaultLowerValue
inline
inputinput
labellabel
lowerValue
onChangedonChange
origin
originFromZero
ranged
showValue
snapToStepstep
stylesclassName
theme
valueFormat