Toggle
A two-state button that can be either on or off.
Installation
Copy the following code into your app directory.
Command
Command
Manual
Manual
uv
Anatomy
Use the following composition to build a Toggle component.
Examples
Icon Toggle Variants
Use toggle() for a pressable on/off control. Control icon behavior with icon_variant="fill" to fill icons on press, or omit it and style manually using data-[pressed] selectors (e.g. text-* or fill-*).
Pressed State
Use default_pressed=True to set the default pressed state of a toggle.
Disabled
Set disabled=True to disable a toggle.