Widgets
Genro Textual wraps 60+ Textual widgets as builder elements. All are available as methods on the page/container.
Containers
Method |
Widget |
Description |
|---|---|---|
|
Vertical |
Arrange children vertically |
|
Horizontal |
Arrange children horizontally |
|
Grid |
Grid layout |
|
Center |
Center children horizontally |
|
Middle |
Center children vertically |
|
VerticalScroll |
Scrollable vertical |
|
HorizontalScroll |
Scrollable horizontal |
|
Container |
Generic container |
Input Widgets
Method |
Widget |
Binding |
|---|---|---|
|
Input |
Writes on blur |
|
Checkbox |
Writes on change |
|
Switch |
Writes on change |
|
RadioButton |
Toggle |
|
RadioSet |
Group of radio buttons |
|
Select |
Dropdown |
|
TextArea |
Multi-line input |
|
Button |
Click handler |
Display Widgets
Method |
Widget |
Description |
|---|---|---|
|
Static |
Display text (bindable) |
|
Label |
Simple label |
|
Markdown |
Render markdown |
|
Rule |
Horizontal/vertical rule |
|
ProgressBar |
Progress indicator |
|
Sparkline |
Data visualization |
|
Digits |
Large digit display |
|
Log |
Append-only text |
|
RichLog |
Rich-formatted log |
Complex Widgets
Method |
Widget |
Description |
|---|---|---|
|
TabbedContent |
Tab container |
|
TabPane |
Tab content |
|
DataTable |
Table with columns/rows |
|
Tree |
Hierarchical tree |
|
Collapsible |
Expandable section |
|
DirectoryTree |
File browser |
App Widgets
Method |
Widget |
Description |
|---|---|---|
|
Header |
App header bar |
|
Footer |
Footer with bindings |
Config (Non-Widget)
Method |
Description |
|---|---|
|
Inline CSS stylesheet |
|
Key binding |
Tree with Store
The Tree widget can display a Bag structure:
page.tree(label="data", store=self.data)
The tree populates recursively. When the Bag changes, the tree updates preserving expanded state.