* tabs widget * click underline * color tweak * docs * docs update * expose Tab * added remove_tab and clear * fix cycling * add animation * docs * changelog * remove recompose * docstrings * Update docs/guide/actions.md Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * Rodrigoed the tabs * Update docs/widgets/tabs.md Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * Update docs/widgets/tabs.md Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * copy * docstrings * docstring * docstring * Apply suggestions from code review Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * stop click * docstring * auto assign consistent IDs * Apply suggestions from code review Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * Document bindings * document bindings * Apply suggestions from code review Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> --------- Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
214 lines
4.4 KiB
Markdown
214 lines
4.4 KiB
Markdown
---
|
|
hide:
|
|
- navigation
|
|
---
|
|
|
|
# Widgets
|
|
|
|
Welcome to the Textual widget gallery.
|
|
|
|
We have many more widgets planned, or you can [build your own](./guide/widgets.md).
|
|
|
|
|
|
!!! info
|
|
|
|
Textual is a **TUI** framework. Everything below runs in the *terminal*.
|
|
|
|
|
|
## Button
|
|
|
|
A simple button with a variety of semantic styles.
|
|
|
|
[Button reference](./widgets/button.md){ .md-button .md-button--primary }
|
|
|
|
```{.textual path="docs/examples/widgets/button.py"}
|
|
```
|
|
|
|
|
|
## Checkbox
|
|
|
|
A classic checkbox control.
|
|
|
|
[Checkbox reference](./widgets/checkbox.md){ .md-button .md-button--primary }
|
|
|
|
```{.textual path="docs/examples/widgets/checkbox.py"}
|
|
```
|
|
|
|
|
|
## ContentSwitcher
|
|
|
|
A widget for containing and switching display between multiple child
|
|
widgets.
|
|
|
|
[ContentSwitcher reference](./widgets/content_switcher.md){ .md-button .md-button--primary }
|
|
|
|
|
|
## DataTable
|
|
|
|
A powerful data table, with configurable cursors.
|
|
|
|
[DataTable reference](./widgets/data_table.md){ .md-button .md-button--primary }
|
|
|
|
```{.textual path="docs/examples/widgets/data_table.py"}
|
|
```
|
|
|
|
## DirectoryTree
|
|
|
|
A tree view of files and folders.
|
|
|
|
[DirectoryTree reference](./widgets/directory_tree.md){ .md-button .md-button--primary }
|
|
|
|
```{.textual path="docs/examples/widgets/directory_tree.py"}
|
|
```
|
|
|
|
## Footer
|
|
|
|
A footer to display and interact with key bindings.
|
|
|
|
[Footer reference](./widgets/footer.md){ .md-button .md-button--primary }
|
|
|
|
```{.textual path="docs/examples/widgets/footer.py" columns="70" lines="12"}
|
|
```
|
|
|
|
|
|
## Header
|
|
|
|
A header to display the app's title and subtitle.
|
|
|
|
|
|
[Header reference](./widgets/header.md){ .md-button .md-button--primary }
|
|
|
|
```{.textual path="docs/examples/widgets/header.py" columns="70" lines="12"}
|
|
```
|
|
|
|
|
|
## Input
|
|
|
|
A control to enter text.
|
|
|
|
[Input reference](./widgets/input.md){ .md-button .md-button--primary }
|
|
|
|
|
|
```{.textual path="docs/examples/widgets/input.py" press="tab,D,a,r,r,e,n"}
|
|
```
|
|
|
|
|
|
## Label
|
|
|
|
A simple text label.
|
|
|
|
[Label reference](./widgets/label.md){ .md-button .md-button--primary }
|
|
|
|
|
|
## ListView
|
|
|
|
Display a list of items (items may be other widgets).
|
|
|
|
[ListView reference](./widgets/list_view.md){ .md-button .md-button--primary }
|
|
|
|
```{.textual path="docs/examples/widgets/list_view.py"}
|
|
```
|
|
|
|
## LoadingIndicator
|
|
|
|
Display an animation while data is loading.
|
|
|
|
[LoadingIndicator reference](./widgets/loading_indicator.md){ .md-button .md-button--primary }
|
|
|
|
```{.textual path="docs/examples/widgets/loading_indicator.py"}
|
|
```
|
|
|
|
## MarkdownViewer
|
|
|
|
Display and interact with a Markdown document (adds a table of contents and browser-like navigation to Markdown).
|
|
|
|
[MarkdownViewer reference](./widgets/markdown_viewer.md){ .md-button .md-button--primary }
|
|
|
|
|
|
```{.textual path="docs/examples/widgets/markdown_viewer.py" columns="100" lines="42"}
|
|
```
|
|
|
|
## Markdown
|
|
|
|
Display a markdown document.
|
|
|
|
[Markdown reference](./widgets/markdown.md){ .md-button .md-button--primary }
|
|
|
|
|
|
```{.textual path="docs/examples/widgets/markdown.py"}
|
|
```
|
|
|
|
|
|
## Placeholder
|
|
|
|
Display placeholder content while you are designing a UI.
|
|
|
|
[Placeholder reference](./widgets/placeholder.md){ .md-button .md-button--primary }
|
|
|
|
|
|
```{.textual path="docs/examples/widgets/placeholder.py"}
|
|
```
|
|
|
|
## RadioButton
|
|
|
|
A simple radio button.
|
|
|
|
[RadioButton reference](./widgets/radiobutton.md){ .md-button .md-button--primary }
|
|
|
|
|
|
```{.textual path="docs/examples/widgets/radio_button.py"}
|
|
```
|
|
|
|
## RadioSet
|
|
|
|
A collection of radio buttons, that enforces uniqueness.
|
|
|
|
[RadioSet reference](./widgets/radioset.md){ .md-button .md-button--primary }
|
|
|
|
```{.textual path="docs/examples/widgets/radio_set.py"}
|
|
```
|
|
|
|
## Static
|
|
|
|
Displays simple static content. Typically used as a base class.
|
|
|
|
[Static reference](./widgets/static.md){ .md-button .md-button--primary }
|
|
|
|
|
|
## Switch
|
|
|
|
A on / off control, inspired by toggle buttons.
|
|
|
|
[Switch reference](./widgets/switch.md){ .md-button .md-button--primary }
|
|
|
|
|
|
```{.textual path="docs/examples/widgets/switch.py"}
|
|
```
|
|
|
|
## Tabs
|
|
|
|
A row of tabs you can select with the mouse or navigate with keys.
|
|
|
|
[Tabs reference](./widgets/tabs.md){ .md-button .md-button--primary }
|
|
|
|
```{.textual path="docs/examples/widgets/tabs.py" press="a,a,a,a,right,right"}
|
|
```
|
|
|
|
|
|
## TextLog
|
|
|
|
Display and update text in a scrolling panel.
|
|
|
|
[TextLog reference](./widgets/text_log.md){ .md-button .md-button--primary }
|
|
|
|
```{.textual path="docs/examples/widgets/text_log.py" press="H,i"}
|
|
```
|
|
|
|
## Tree
|
|
|
|
A tree control with expandable nodes.
|
|
|
|
[Tree reference](./widgets/tree.md){ .md-button .md-button--primary }
|
|
|
|
```{.textual path="docs/examples/widgets/tree.py"}
|
|
```
|