Druid button, how to implement a toggle button

Hi everyone,

when using druid, I know I can implement and set a style to change the appearance of a button, e.g. on_click, on_mouse_hover, etc… this works, but when it comes to implement a toggle button, i am not sure how to implement this in a straightforward way.

Where should I keep the current state of the button? is there already a toggle button implementation i could use? If anyone could give me a minimal example how to do this in a modular way, this would be great! Thanks

What I would do in this situation would be to create a custom druid component and look at the checkbox components source code.

Perhaps you could even use the checkbox as is. I’m not sure how flexible it is as I haven’t used it yet.