import * as React from 'react'; import { Slider as DeprecatedSlider } from '@fluentui/react-experiments'; import { IStackTokens, Stack } from '@fluentui/react'; // Workaround to prevent errors on usage of Slider, without disabling all deprecation checks // eslint-disable-next-line deprecation/deprecation const Slider = DeprecatedSlider; export interface ISliderBasicExampleState { value: number; } const stackTokens: IStackTokens = { childrenGap: 30 }; /* eslint-disable react/jsx-no-bind */ export class SliderExample extends React.Component<{}, ISliderBasicExampleState> { public state: ISliderBasicExampleState = { value: 0 }; public render(): JSX.Element { const marks = [ { value: 0, label: '0°C', }, { value: 30, label: '30°C', }, { value: 80, label: '80°C', }, { value: 100, label: '100°C', }, ]; return ( console.log(value)} /> console.log(value)} snapToStep /> console.log(value)} showThumbTooltip marks={marks} /> this.setState({ value })} showValue={true} /> `${value}%`} showValue={true} /> ); } }