Crate rat_widget
source ·Expand description
§Rat-Widgets
This crate tries to provide an extended set of widgets with
- Eventhandling (currently crossterm, but not limited)
- Focus
- Scrolling
- Wrappers for other external widgets.
It combines different aspects that have all been published as separate crates:
- rat-event: Define a generalized event-handling trait.
- rat-focus: Focus handling for widgets.
- rat-scrolled: Widgets for scrolling.
- rat-ftable: Table widget for large data-sets.
This crate is part of rat-salsa.
§Widgets
These widgets are ratatui widgets.
Eventhandling is currently crossterm only. In practice event-handling is calling 1 or 2 functions on the state, so this should be easy to map to other systems. (Contributions welcome :)
§TextArea
Editable text area.
- Range based text styles.
- Text selection with keyboard + mouse
- Possible states as style: Focused
- Emoji supported.

§TextInput
Basic text input field.
- Text selection with keyboard + mouse
- Possible states as styles: Focused, Invalid
§MaskedInput
Text input with an input mask.
- Text selection with keyboard + mouse
- Possible states as styles: Focused, Invalid
- Pattern based input -> “##,###,##0.00”
- number patterns:
09#-+., - numeric text:
HhOoDd - text:
lac_ - arbitrary separators between sub-fields
- number patterns:
- info-overlay for sub-fields without value
- Localization with [rat-input::NumberSymbols] based on pure-rust-locales
§Button
Simple button widget.
§DateInput, NumberInput
Date input with format strings parsed by chrono. Number input with format strings parsed by format_num_pattern
§Month
Widget for calender display.
§MenuLine, PopupMenu and MenuBar
Menu widgets.
§StatusLine
Statusline with multiple segments.
§TODO
… more widgets
Modules§
- A button widget.
- Render a month of a calendar. Can be localized with a chrono::Locale.
- A widget for date-input using chrono
- Event-handler traits and Keybindings.
- Clears an area with a Style and a fill char.
- Module for focus-handling functionality. For details see rat-focus
- Text input widget.
- Some functions that calculate more complicate layouts.
- Ratatui list adapter.
- Text input with an input mask.
- A menubar widget with sub-menus.
- Draws a simple line menu.
- A message dialog.
- Widget for number input
- This widget draws a popup-menu.
- Scrolled widget and viewports.
- Basic status line with multiple sections.
- F-Table
- A text-area with text-styling abilities.
Enums§
- Locales matching the locales in
glibc.