# Updated Material 3 `Slider`

> The `Slider` widget has been updated to match the Material 3 Design specifications.




:::important
These breaking change docs are accurate, as of the release
under which they are published. Over time, the
workarounds described here might become inaccurate.
We don't, in general, keep these breaking change docs up
to date as of each release.

The [breaking change index file](/release/breaking-changes)
lists the docs created for each release.
:::


## Summary

The `Slider` has been updated to match the Material 3 Design specifications.

The `Slider` changes include an updated height,
a gap between the active and inactive track, and
a stop indicator to show the end value of the inactive track.
Pressing the thumb adjusts its width, and the track adjusts its shape.
The new value indicator shape is a rounded rectangle.
New color mappings have also been introduced for some of the `Slider` shapes.

## Context

The Material 3 Design specs for the `Slider` were updated in December 2023.
To opt into the 2024 design spec, set the `Slider.year2023` flag to `false`.
This is done to ensure that existing apps aren't affected by
the updated design specifications.

## Description of change

The `Slider` widget has a `year2023` flag that can be set to `false` to
opt in to the updated design spec.
The default value for the `year2023` flag is `true`,
which means that the `Slider` uses the previous 2023 design specifications.

When [`Slider.year2023`][] is set to `false`,
the slider uses the updated design specifications.

## Migration guide

To opt into the updated design spec for the `Slider`,
set the `year2023` flag to `false`:

```dart highlightLines=2
Slider(
  year2023: false,
  value: _value,
  onChanged: (value) {
    setState(() {
      _value = value;
    });
  },
),
```

To update your entire app to use the updated `Slider` design, set the
`SliderThemeData.year2023` property to `false` in your `MaterialApp`:

```dart highlightLines=2
return MaterialApp(
  theme: ThemeData(sliderTheme: const SliderThemeData(year2023: false)),
        // ...
        Slider(
          value: _value,
          onChanged: (value) {
            setState(() {
              _value = value;
            });
          },
        ),
        // ...
```

## Timeline

Landed in version: 3.28.0-0.1.pre<br>
In stable release: 3.29

## References

API documentation:

* [`Slider`][]
* [`Slider.year2023`][]

Relevant issues:

* [Update `Slider` for Material 3 redesign][]

Relevant PRs:

* [Introduce new Material 3 `Slider` shapes][]

[`Slider`]: https://main-api.flutter.dev/flutter/material/Slider-class.html
[`Slider.year2023`]: https://main-api.flutter.dev/flutter/material/Slider/year2023.html
[Update `Slider` for Material 3 redesign]: https://github.com/flutter/flutter/issues/141842
[Introduce new Material 3 `Slider` shapes]: https://github.com/flutter/flutter/pull/152237

