Expand description
Checkbox widget.
Can use a third optional/defaulted state too.
ⓘ
use rat_widget::checkbox::{Checkbox, CheckboxState};
use ratatui::widgets::StatefulWidget;
Checkbox::new()
.text("Carrots 🥕")
.default_settable()
.styles(THEME.checkbox_style())
.render(layout[1][1], frame.buffer_mut(), &mut state.c1);
Checkbox::new()
.text("Potatoes 🥔\nTomatoes 🍅")
.default_settable()
.styles(THEME.checkbox_style())
.render(layout[1][2], frame.buffer_mut(), &mut state.c2);Structs§
- Checkbox
- Checkbox widget.
- Checkbox
State - State.
- Checkbox
Style - Composite style.
Enums§
- Checkbox
Check - Enum controling the behaviour of the Checkbox.
Functions§
- handle_
events - Handle all events. Text events are only processed if focus is true. Mouse events are processed if they are in range.
- handle_
mouse_ events - Handle only mouse-events.