mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Document Header widget
This commit is contained in:
12
docs/examples/widgets/header.py
Normal file
12
docs/examples/widgets/header.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from textual.app import App, ComposeResult
|
||||||
|
from textual.widgets import Header
|
||||||
|
|
||||||
|
|
||||||
|
class HeaderApp(App):
|
||||||
|
def compose(self) -> ComposeResult:
|
||||||
|
yield Header()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
app = HeaderApp()
|
||||||
|
app.run()
|
||||||
1
docs/reference/header.md
Normal file
1
docs/reference/header.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
::: textual.widgets.Header
|
||||||
@@ -15,7 +15,7 @@ widget. Notice how the `Footer` automatically displays the keybind.
|
|||||||
```{.textual path="docs/examples/widgets/footer.py"}
|
```{.textual path="docs/examples/widgets/footer.py"}
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "button.py"
|
=== "footer.py"
|
||||||
|
|
||||||
```python
|
```python
|
||||||
--8<-- "docs/examples/widgets/footer.py"
|
--8<-- "docs/examples/widgets/footer.py"
|
||||||
|
|||||||
@@ -1 +1,34 @@
|
|||||||
# Header
|
# Header
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
A simple header widget which docks itself to the top of the parent container.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
The example below shows an app with a `Header`.
|
||||||
|
|
||||||
|
=== "Output"
|
||||||
|
|
||||||
|
```{.textual path="docs/examples/widgets/header.py"}
|
||||||
|
```
|
||||||
|
|
||||||
|
=== "header.py"
|
||||||
|
|
||||||
|
```python
|
||||||
|
--8<-- "docs/examples/widgets/header.py"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Reactive Attributes
|
||||||
|
|
||||||
|
| Name | Type | Default | Description |
|
||||||
|
|--------|--------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `tall` | `bool` | `True` | Whether the `Header` widget is displayed as tall or not. The tall variant is 3 cells tall by default. The non-tall variant is a single cell tall. This can be toggled by clicking on the header. |
|
||||||
|
|
||||||
|
## Messages
|
||||||
|
|
||||||
|
This widget sends no messages.
|
||||||
|
|
||||||
|
## See Also
|
||||||
|
|
||||||
|
* [Header](../reference/header.md) code reference
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ nav:
|
|||||||
- "reference/events.md"
|
- "reference/events.md"
|
||||||
- "reference/footer.md"
|
- "reference/footer.md"
|
||||||
- "reference/geometry.md"
|
- "reference/geometry.md"
|
||||||
|
- "reference/header.md"
|
||||||
- "reference/index.md"
|
- "reference/index.md"
|
||||||
- "reference/message_pump.md"
|
- "reference/message_pump.md"
|
||||||
- "reference/message.md"
|
- "reference/message.md"
|
||||||
|
|||||||
Reference in New Issue
Block a user