Module checkbox

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.

Enums§

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