Module checkbox

Source
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.
CheckboxState
State.
CheckboxStyle
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.