Skip to content

SliderCore

@Composable



fun SliderCore(
    value: Float, 
    onValueChange: (Float) -> Unit, 
    modifier: Modifier = Modifier, 
    enabled: Boolean = true, 
    steps: Int = 0, 
    onValueChangeFinished: () -> Unit = {}, 
    content: @Composable



 (isHovered: Boolean, isDragging: Boolean, isFocused: Boolean, normalizedValue: Float) -> Unit
)

Low-level unstyled slider behavior: drag/click-to-position, hover/drag/focus state tracking, with no visuals of its own.

A vanilla keyboard/controller focus-navigation stop - unlike the simple toggle inputs (Checkbox, Switch, RadioButton), a slider has no single "activate" action, so instead of Clickable's Enter/Space it responds to Left/Right arrow keys while focused, nudging the value by one steps increment (or KEYBOARD_STEP_FALLBACK when continuous).

Parameters

  • value: The current value, normalized/snapped via snapSliderValue.

  • onValueChange: Called with the new normalized value on every drag/click/arrow-key update.

  • modifier: Additional modifiers applied to the outer container.

  • enabled: When false, pointer and arrow-key events are ignored and this drops out of the vanilla focus graph entirely.

  • steps: Number of discrete increments to snap to; 0 means continuous.

  • onValueChangeFinished: Called once when a drag or arrow-key interaction ends.

  • content: The visual content; receives hover/drag/focus state and the normalized, snapped value to render.