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.
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.