Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove Default padding around checkboxes in Jetpack Compose new update

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?

like image 362
Harish Padmanabh Avatar asked Sep 10 '25 08:09

Harish Padmanabh


2 Answers

You need to provide it with CompositionLocalProvider

CompositionLocalProvider(LocalMinimumInteractiveComponentEnforcement provides false) {
    Checkbox(
        checked = checked,
        onCheckedChange = {
            checked = it
        }
    )
}
like image 123
Thracian Avatar answered Sep 12 '25 23:09

Thracian


androidx.compose.material3:material3:1.3.0-beta04

CompositionLocalProvider(LocalMinimumInteractiveComponentSize provides Dp.Unspecified) {
                Checkbox(
                    checked = checked,
                    onCheckedChange = {
                        checked = it
                    }
                )
            }
like image 38
Emin Turk Avatar answered Sep 12 '25 23:09

Emin Turk