# Centered Slider in Jetpack Compose

DevFeed: [Centered Slider in Jetpack Compose](<https://devfeed.tech/articles/centered-slider-in-jetpack-compose-25769.md>)

Original publisher: [Read original article](<https://www.sinasamaki.com/centered-slider-in-jetpack-compose/>)

Author: sinasamaki

Published: 2024-11-08T18:06:10Z

Content type: article

Language: en

Sources: [sinasamaki](<https://devfeed.tech/sources/sinasamaki.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>), [User Experience](<https://devfeed.tech/topics/user-experience.md>), [Material Design](<https://devfeed.tech/topics/material-design.md>), [User interface design](<https://devfeed.tech/topics/ui-design.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [material](<https://devfeed.tech/tags/material.md>)

## AI overview

The article builds a customizable centered slider for Jetpack Compose, addressing the excerpt's stated gap in the Material 3 library. A center value lets users adjust in either direction, such as changing contrast from zero. The added snap threshold returns the slider to its center when a new value is close enough; setting the threshold to zero disables snapping. A center indicator can mark the midpoint, and a custom track composable receives the active section's bounds so active and inactive sections can be styled differently, including coloring the active line according to whether the value is above or below center. The excerpt begins describing implementation with Material 3's Slider and optional haptic feedback, but ends mid-sentence.

## Source excerpt

Creating a glowy centered slider based on the material 3 slider