Skip to main content

Module widgets

Module widgets 

Source
Expand description

Contains widgets (Layout, Block, Span) A collection of types that implement the [Widget] trait.

This module provides a variety of TUI components (widgets) used for rendering.

§Available widgets:

  • [BgGrad]: A container widget that renders a gradient background behind its child widget.
  • [Block]: A widget that wrap another widget and adds border and title.
  • [Grad]: A widget for rendering text with a gradient foreground color.
  • [Grid]: A layout widget that arranges children in a grid specified by rows and columns.
  • [Layout]: A container widget that arranges child widgets in a single direction, flexing their sizes based on given constraints.
  • [List]: A scrollable list widget with suuport for item selection and highlighting.
  • [Overlay]: A widget that stacks its children in layers, from bottom to top.
  • [Paragraph]: A widget combining multiple widgets implementing the [Text] trait into single widget.
  • [ProgressBar]: A widget that displays a horizontal progress bar.
  • [Scrollable]: A wrapper widget that adds scrollability to its child when content overflows.
  • [Scrollbar]: A scrollbar widget that can be either vertical or horizontal.
  • [Spacer]: A spacer widget used for layout spacing.
  • [Span]: A widget for styling text where all characters share the same style.
  • [Table]: A widget that displays a table with configurable column widths, optional header and scrollable row content.

Modules§

cache

Structs§

BgGrad
A container widget that renders a gradient background behind its child widget. A container widget that renders a gradient background behind its child widget.
Block
A widget that wrap another widget and adds border and title. A widget that wraps another widget and adds border and title.
Element
A container for any widget implementing the Widget trait. A container for any widget implementing the Widget trait.
Grad
A widget for rendering text with a gradient foreground color. A widget for rendering text with a gradient foreground color.
Grid
A layout widget that arranges children in a grid specified by rows and columns. A layout widget that arranges children in a grid specified by rows and columns.
Layout
A container widget that arranges child widgets in a single direction, flexing their sizes based on given constraints. A container widget that arranges child widgets in a single direction (horizontal or vertical), flexing their sizes based on given constraints.
List
A scrollable list widget with suuport for item selection and highlighting. A scrollable list widget with suuport for item selection and highlighting.
ListState
State of the List widget, including scroll offset and selected index. State of the List widget, including scroll offset and selected index.
Overlay
A widget that stacks its children in layers, from bottom to top. A widget that stacks its children in layers, from bottom to top.
Paragraph
A widget combining multiple widgets implementing the Text trait into single widget. A Paragraph combines multiple widgets implementing the Text trait into single widget, displaying them sequantially with configurable separator.
ProgressBar
A widget that displays a horizontal progress bar. A widget that displays a horizontal progress bar.
Row
Represents a single row in a [Table] widget.
Scrollable
A wrapper widget that adds scrollability to its child when content overflows. A wrapper widget that adds scrollability to its child when content overflows.
Scrollbar
A scrollbar widget that can be either vertical or horizontal. A scrollbar widget that can be either vertical or horizontal.
ScrollbarState
Represents the scroll state shared by a Scrollbar and the app itself. Represents the scroll state shared by a Scrollbar and the app itself.
Spacer
A spacer widget used for layout spacing. A spacer widget used for layout spacing.
Span
A widget for styling text where all characters share the same style. A widget for styling text where all characters share the same style.
Table
A widget that displays a table with configurable column idths, optional header and scrollable row content. A widget that displays a table with configurable column widths, optional header and scrollable row content.
TableState
State of the Table widget, including scroll offset, selected index and selected column. State of the Table widget, including scroll offset, selected index and selected column.

Traits§

ToSpan
Enables creating Span by calling one of the functions on type implementing this trait. Enables creating Span by calling one of the functions on type implementing this trait.
Widget
Trait implemented by all the widgets. Trait implemented by all the widgets.