Document Static widget

This commit is contained in:
Darren Burns
2022-10-04 13:35:56 +01:00
parent 48ae4c87b1
commit 8225b43ac1
3 changed files with 47 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
from textual.app import App, ComposeResult
from textual.widgets import Static
class StaticApp(App):
def compose(self) -> ComposeResult:
yield Static("Hello, world!")
if __name__ == "__main__":
app = StaticApp()
app.run()

View File

@@ -1 +1,33 @@
# Static
## Description
A widget which displays a static renderable content.
Can be used for simple text labels, but can also contain more complex Rich renderables.
## Example
The example below shows how you can use a `Static` widget as a simple text label.
=== "Output"
```{.textual path="docs/examples/widgets/static.py"}
```
=== "static.py"
```python
--8<-- "docs/examples/widgets/static.py"
```
## Reactive Attributes
This widget has no reactive attributes.
## Messages
This widget sends no messages.
## See Also
* [Static](../reference/static.md) code reference