Skip to content

Instantly share code, notes, and snippets.

@aritra-tech
Created May 9, 2024 15:23
Show Gist options
  • Save aritra-tech/59c839a15066a258d2e6a4411d957a98 to your computer and use it in GitHub Desktop.
Save aritra-tech/59c839a15066a258d2e6a4411d957a98 to your computer and use it in GitHub Desktop.
@Composable
fun SliderExample() {
var value by remember { mutableFloatStateOf(4f) }
Column(
Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
InlineSlider(
value = value,
onValueChange = { value = it },
increaseIcon = { Icon(InlineSliderDefaults.Increase, "Increase") },
decreaseIcon = { Icon(InlineSliderDefaults.Decrease, "Decrease") },
valueRange = 3f..6f,
steps = 5,
segmented = true
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment