Thread
#compose
    m

    Marcin Mazurek

    1 year ago
    Hi how to change Checkbox rounded corner for Box, after check the code i think it is impossible. Radius should be changeable from the outside
    @Composable
    private fun CheckboxImpl(
        enabled: Boolean,
        value: ToggleableState,
        modifier: Modifier,
        colors: CheckboxColors
    ) {
    ....
            drawBox(
                boxColor = boxColor,
                borderColor = borderColor,
                radius = RadiusSize.toPx(),
                strokeWidth = strokeWidthPx
            )
    k

    Kirill Grouchnikov

    1 year ago
    Not everything in Material components is configurable like that. This is a snippet from the material checkbox implementation that follows that specific design language. You can copy specific bits over to your codebase and make it as configurable as your own design language needs to be.
    m

    Marcin Mazurek

    1 year ago
    hmm i think change corner radius should be a standard, of course i can copy it and change it. But i think that i will be not only that want to change it. Also other composable have this option, that's why i was surprised that i can't change it
    But thanks for your response 🙂
    Chris Sinco [G]

    Chris Sinco [G]

    1 year ago
    In the Material Design system, changing corner radius on specific components is done via Shape theming / shape parameter. Checkboxes do not use Shape theming so the corner radius is set. As Kirill mentioned above, if you’d like a different look for it, you’ll have to create your own.
    I will certainly pass your feedback along to the Material Design team that checkboxes should be shape themeable
    k

    Kirill Grouchnikov

    1 year ago
    Not sure if checkboxes or radio buttons should be shapeable, at least at the Material level. There's a rather strong existing visual reference of how a checkbox is "supposed" to look like vs a radiobutton,
    m

    Marcin Mazurek

    1 year ago
    Thanks and of course, all you are doing great work. 😃
    louiscad

    louiscad

    1 year ago
    I think checkboxes should be shape themable. I see people making them round (like in Apple Notes), square (like on Windows I think), and maybe some other shapes, though not sure which.
    Chris Sinco [G]

    Chris Sinco [G]

    1 year ago
    Sure, but those are distinct styles for that platform. I think Material wants to keep the style of this common control consistent in Android so probably why it’s not shape themeable. Like on iOS, the checkbox in Notes and Reminders are both round circles. And in Windows it’s square on Windows apps. Which I think is intentional as the platform guidance.
    Now I know designers tend to make iOS designs first/only which doesn’t help, but that’s a different convo)