Overview
ACheckbox is a box that can be checked or unchecked to represent binary choices. It can optionally have a text label and supports custom styling.
Constructor
checkbox::Checkbox::new
Checkbox with the given checked state.
Parameters:
is_checked- Whether the checkbox is currently checked
Builder Methods
Label
label
Event Handlers
on_toggle
on_toggle_maybe
None, the checkbox will be disabled.
Layout
width
size
spacing
Text Styling
text_size
line_height
shaping
wrapping
font
Icon
icon
Appearance
style
Status
Style
Built-in Styles
primary- Primary checkbox stylesecondary- Secondary checkbox stylesuccess- Success/positive checkbox (green)danger- Danger/negative checkbox (red)
Examples
Basic Checkbox
Disabled Checkbox
Styled Checkbox
Custom Size and Spacing
Conditionally Enabled
Custom Style
Related
Button
For clickable actions
Slider
For selecting values from a range
