Expand description
widgets is a collection of types that implement Widget or StatefulWidget or both.
The widgets provided with Ratatui are implemented in the ratatui_widgets crate, and are
re-exported here. The Widget and StatefulWidget traits are implemented in the
ratatui_core crate and are also re-exported in this module. This means that you can use
these types directly from the ratatui crate without having to import the ratatui_widgets
crate.
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.RatatuiLogo: displays the Ratatui logo.RatatuiMascot: displays the Ratatui mascot.
Modules§
- block
- Elements related to the
Blockbase widget. - calendar
widget-calendar - A simple calendar widget.
(feature: widget-calendar) - canvas
- A
Canvasand a collection ofShapes.
Structs§
- Axis
- An X or Y axis for the
Chartwidget - Bar
- A bar to be shown by the
BarChartwidget. - BarChart
- A chart showing values as bars.
- BarGroup
- A group of bars to be shown by the Barchart.
- Block
- Base widget to be used to display a box border around all other built-in widgets.
- Borders
- Bitflags that can be composed to set the visible borders essentially on the block widget.
- Cell
- A
Cellcontains theTextto be displayed in aRowof aTable. - Chart
- A widget to plot one or more
Datasetin 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.
- Line
Gauge - 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)
- List
Item - A single item in a
List - List
State - State of the
Listwidget - Padding
- Defines the padding for a
Block. - Paragraph
- A widget to display some text.
- Ratatui
Logo - A widget that renders the Ratatui logo
- Ratatui
Mascot - A widget that renders the Ratatui mascot
- Row
- A single row of data to be displayed in a
Tablewidget. - Scrollbar
- A widget to display a scrollbar
- Scrollbar
State - A struct representing the state of a Scrollbar widget.
- Sparkline
- Widget to render a sparkline over one or more lines.
- Sparkline
Bar - An bar in a
Sparkline. - Table
- A widget to display data in formatted columns.
- Table
State - State of a
Tablewidget - Tabs
- A widget that displays a horizontal set of Tabs with a single tab selected.
- Wrap
- Describes how to wrap text across lines.
Enums§
- Border
Type - The type of border of a
Block. - Graph
Type - Used to determine which style of graphing to use
- Highlight
Spacing - This option allows the user to configure the “highlight symbol” column width spacing
- Legend
Position - Allow users to specify the position of a legend in a
Chart - List
Direction - Defines the direction in which the list will be rendered.
- Mascot
EyeColor - State for the mascot’s eye
- Ratatui
Logo Size - The size of the logo
- Render
Direction - Defines the direction in which sparkline will be rendered.
- Scroll
Direction - An enum representing a scrolling direction.
- Scrollbar
Orientation - This is the position of the scrollbar around a given area.
Traits§
- Frame
Ext unstable-widget-ref - Extension trait for [
Frame] that provides methods to renderWidgetRefandStatefulWidgetRefto the current buffer. - Stateful
Widget - A
StatefulWidgetis a widget that can take advantage of some local state to remember things between two draw calls. - Stateful
Widget Ref unstable-widget-ref - Stability
- Widget
- A
Widgetis a type that can be drawn on aBufferin a givenRect. - Widget
Ref unstable-widget-ref - Stability