Widgets
Widgets
All 24 widgets, with a captured frame at three widths for each.
TermMosaic ships 24 widgets. That number is the whole claim and it is counted, not estimated: it is every exported type with a New… constructor that satisfies termmosaic.Widget, and buffer.Buffer is deliberately not on the list because it is what widgets draw into, not a widget.
widgets/form/optionlist.go is an unexported shared helper behind Select, Tabs and KeyHint; it is not a twenty-fifth widget.
There is no Form container widget. A Form type would have been a second way to do what ADR 0004’s constraint solver and the layout package already do, so it was not built. See Forms for how the form widgets compose.
Every page below carries the widget’s captured frame at 40, 80 and 120 columns. Read what a capture can and cannot show before you read one as a promise about your own terminal.
| Widget |
Summary |
MinSize |
Block |
A bordered, titled, padded rectangle that other widgets draw inside. |
5×5 |
| Widget |
Summary |
MinSize |
Text |
A single line of styled spans, aligned within its rectangle. |
— |
Paragraph |
Wrapped, styled prose that reflows to the width it is given. |
— |
| Widget |
Summary |
MinSize |
Split |
A container that divides its rectangle among focusable panes. |
3×1 |
| Widget |
Summary |
MinSize |
TextInput |
A single-line editable field with a cursor, a selection and undo. |
1×1 |
TextArea |
A multi-line editable field with wrapping, selection and undo. |
1×1 |
Select |
A single-choice control that expands into a scrollable list. |
1×1 |
Checkbox |
A tri-state box: unchecked, checked, or indeterminate. |
1×5 |
Radio |
A single-choice group of labels, navigated with the arrow keys. |
6×1 |
Toggle |
A two-state switch with an on and an off rendering. |
6×1 |
Tabs |
A horizontal strip of labels, one of which is the active pane. |
1×1 |
Button |
A labelled, activatable control with a default and a disabled state. |
3×1 |
KeyHint |
A one-line bar of key names and their meanings. |
1×1 |
| Widget |
Summary |
MinSize |
List |
A scrollable, selectable list with a marker gutter and a scrollbar. |
10×3 |
Table |
Rows in columns, with a header, a selection and horizontal scrolling. |
12×4 |
Tree |
A hierarchy with expandable nodes, keyboard navigation and lazy row rendering. |
14×4 |
Pager |
A scrollable long text with search, match highlighting and a position readout. |
10×4 |
| Widget |
Summary |
MinSize |
ProgressBar |
A ratio from 0 to 1 drawn as a filled block-element bar. |
14×3 |
Gauge |
A bounded reading drawn as a Braille dial or a fallback bar. |
11×7 |
Meter |
A budget with named zones, a threshold marker and the active zone’s name in words. |
18×3 |
Sparkline |
A series of numbers drawn as Braille or block elements, scaled to its own range. |
5×3 |
BarChart |
Categorical magnitudes as horizontal or vertical bars, with an axis and per-bar values. |
8×6 |
| Widget |
Summary |
MinSize |
Menu |
A navigable menu with nested submenus to arbitrary depth. |
16×4 |
| Widget |
Summary |
MinSize |
Dialog |
A modal box with a title, a body and a row of actions. |
28×4 |
Pages in this section
-
Block
A bordered, titled, padded rectangle that other widgets draw inside.
-
Text
A single line of styled spans, aligned within its rectangle.
-
Paragraph
Wrapped, styled prose that reflows to the width it is given.
-
Split
A container that divides its rectangle among focusable panes.
-
TextInput
A single-line editable field with a cursor, a selection and undo.
-
TextArea
A multi-line editable field with wrapping, selection and undo.
-
Select
A single-choice control that expands into a scrollable list.
-
Checkbox
A tri-state box: unchecked, checked, or indeterminate.
-
Radio
A single-choice group of labels, navigated with the arrow keys.
-
Toggle
A two-state switch with an on and an off rendering.
-
Tabs
A horizontal strip of labels, one of which is the active pane.
-
Button
A labelled, activatable control with a default and a disabled state.
-
KeyHint
A one-line bar of key names and their meanings.
-
List
A scrollable, selectable list with a marker gutter and a scrollbar.
-
Table
Rows in columns, with a header, a selection and horizontal scrolling.
-
Tree
A hierarchy with expandable nodes, keyboard navigation and lazy row rendering.
-
Pager
A scrollable long text with search, match highlighting and a position readout.
-
ProgressBar
A ratio from 0 to 1 drawn as a filled block-element bar.
-
Gauge
A bounded reading drawn as a Braille dial or a fallback bar.
-
Meter
A budget with named zones, a threshold marker and the active zone's name in words.
-
Sparkline
A series of numbers drawn as Braille or block elements, scaled to its own range.
-
BarChart
Categorical magnitudes as horizontal or vertical bars, with an axis and per-bar values.
-
Menu
A navigable menu with nested submenus to arbitrary depth.
-
Dialog
A modal box with a title, a body and a row of actions.