Module widgets

Source
Expand description

widgets is a collection of types that implement Widget or StatefulWidget or both.

Widgets are created for each frame as they are consumed after rendered. They are not meant to be stored but used as commands to draw common figures in the UI.

The available widgets are:

  • Block: a basic widget that draws a block with optional borders, titles and styles.
  • BarChart: displays multiple datasets as bars with optional grouping.
  • calendar::Monthly: displays a single month.
  • Canvas: draws arbitrary shapes using drawing characters.
  • Chart: displays multiple datasets as a lines or scatter graph.
  • Clear: clears the area it occupies. Useful to render over previously drawn widgets.
  • Gauge: displays progress percentage using block characters.
  • LineGauge: display progress as a line.
  • List: displays a list of items and allows selection.
  • Paragraph: displays a paragraph of optionally styled and wrapped text.
  • Scrollbar: displays a scrollbar.
  • Sparkline: display a single data set as a sparkline.
  • Table: displays multiple rows and columns in a grid and allows selection.
  • Tabs: displays a tab bar and allows selection.

Re-exports§

pub use self::block::Block;
pub use self::block::BorderType;
pub use self::block::Padding;

Modules§

block
Elements related to the Block base widget.
calendarwidget-calendar
A simple calendar widget. (feature: widget-calendar)
canvas
A Canvas and a collection of Shapes.

Macros§

bordermacros
Macro that constructs and returns a combination of the Borders object from TOP, BOTTOM, LEFT and RIGHT.

Structs§

Axis
An X or Y axis for the Chart widget
Bar
A bar to be shown by the BarChart widget.
BarChart
A chart showing values as bars.
BarGroup
A group of bars to be shown by the Barchart.
Borders
Bitflags that can be composed to set the visible borders essentially on the block widget.
Cell
A Cell contains the Text to be displayed in a Row of a Table.
Chart
A widget to plot one or more Dataset in a cartesian coordinate system
Clear
A widget to clear/reset a certain area to allow overdrawing (e.g. for popups).
Dataset
A group of data points
Gauge
A widget to display a progress bar.
LineGauge
A compact widget to display a progress bar over a single thin line.
List
A widget to display several items among which one can be selected (optional)
ListItem
A single item in a List
ListState
State of the List widget
Paragraph
A widget to display some text.
RatatuiLogo
A widget that renders the Ratatui logo
Row
A single row of data to be displayed in a Table widget.
Scrollbar
A widget to display a scrollbar
ScrollbarState
A struct representing the state of a Scrollbar widget.
Sparkline
Widget to render a sparkline over one or more lines.
SparklineBar
An bar in a Sparkline.
Table
A widget to display data in formatted columns.
TableState
State of a Table widget
Tabs
A widget that displays a horizontal set of Tabs with a single tab selected.
Wrap
Describes how to wrap text across lines.

Enums§

GraphType
Used to determine which style of graphing to use
HighlightSpacing
This option allows the user to configure the “highlight symbol” column width spacing
LegendPosition
Allow users to specify the position of a legend in a Chart
ListDirection
Defines the direction in which the list will be rendered.
RatatuiLogoSize
The size of the logo
RenderDirection
Defines the direction in which sparkline will be rendered.
ScrollDirection
An enum representing a scrolling direction.
ScrollbarOrientation
This is the position of the scrollbar around a given area.

Traits§

StatefulWidget
A StatefulWidget is a widget that can take advantage of some local state to remember things between two draw calls.
StatefulWidgetRefunstable-widget-ref
A StatefulWidgetRef is a trait that allows rendering a stateful widget by reference.
Widget
A Widget is a type that can be drawn on a Buffer in a given Rect.
WidgetRefunstable-widget-ref
A WidgetRef is a trait that allows rendering a widget by reference.