Remove Default padding around checkboxes in Jetpack Compose new update

Viewed 763

In the new update of jetpack compose , a default padding space will be provided around the touchables as said in official documentation. Refer this

Please help how to avoid this and to implement this "set LocalMinimumTouchTargetEnforcement to false " and where to do this?

2 Answers

You need to provide it with CompositionLocalProvider

CompositionLocalProvider(LocalMinimumTouchTargetEnforcement provides false) {
    Checkbox(
        checked = checked,
        onCheckedChange = {
            checked = it
        }
    )
}

Try that:

Checkbox(modifier = Modifier.absoluteOffset((-12).dp, 0.dp))
Related