Toggle button — Kivy v1.0.1-dev documentation

# Toggle button

The toggle button act like a checkbox. When you touch it, his state will be ‘down’. You need to touch it again to make his state to ‘up’.

The toggle button is also able to handle group. Only one button can be pushed in the same group. The group name can be a string, or any hashable Python object.

    btn1 = ToggleButton(text='Male', group='sex')
    btn2 = ToggleButton(text='Female', group='sex')
    btn3 = ToggleButton(text='Mixed', group='sex')

Only one of them could be checked.

class `kivy.uix.togglebutton.` `ToggleButton`(**kwargs)

  Bases: `kivy.uix.button.Button`

  Toggle button class, see module documentation for more information.

  `group`

    Group of the button. If None, no group will be used. `group` must be an hashable object, like a string.

    `group` is a `ObjectProperty`