Horizontal drag
The handle follows your finger, clamped to a 0..220 dp range.
var offset by remember { mutableFloatStateOf(0f) }
Box(
Modifier
.offset { IntOffset(offset.roundToInt(), 0) }
.size(64.dp)
.clip(RoundedCornerShape(12.dp))
.background(MaterialTheme.colorScheme.primary)
.draggable(
orientation = Orientation.Horizontal,
state = rememberDraggableState { delta ->
offset = (offset + delta).coerceIn(0f, 600f)
}
)
)