mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Merge branch 'main' into list-view
This commit is contained in:
47
docs/widgets/placeholder.md
Normal file
47
docs/widgets/placeholder.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# Placeholder
|
||||
|
||||
|
||||
A widget that is meant to have no complex functionality.
|
||||
Use the placeholder widget when studying the layout of your app before having to develop your custom widgets.
|
||||
|
||||
The placeholder widget has variants that display different bits of useful information.
|
||||
Clicking a placeholder will cycle through its variants.
|
||||
|
||||
- [ ] Focusable
|
||||
- [ ] Container
|
||||
|
||||
## Example
|
||||
|
||||
The example below shows each placeholder variant.
|
||||
|
||||
=== "Output"
|
||||
|
||||
```{.textual path="docs/examples/widgets/placeholder.py"}
|
||||
```
|
||||
|
||||
=== "placeholder.py"
|
||||
|
||||
```python
|
||||
--8<-- "docs/examples/widgets/placeholder.py"
|
||||
```
|
||||
|
||||
=== "placeholder.css"
|
||||
|
||||
```css
|
||||
--8<-- "docs/examples/widgets/placeholder.css"
|
||||
```
|
||||
|
||||
## Reactive Attributes
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| ---------- | ------ | ----------- | -------------------------------------------------- |
|
||||
| `variant` | `str` | `"default"` | Styling variant. One of `default`, `size`, `text`. |
|
||||
|
||||
|
||||
## Messages
|
||||
|
||||
This widget sends no messages.
|
||||
|
||||
## See Also
|
||||
|
||||
* [Placeholder](../api/placeholder.md) code reference
|
||||
44
docs/widgets/text_log.md
Normal file
44
docs/widgets/text_log.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# TextLog
|
||||
|
||||
A TextLog is a widget which displays scrollable content that may be appended to in realtime.
|
||||
|
||||
Call [TextLog.write][textual.widgets.TextLog.write] with a string or [Rich Renderable](https://rich.readthedocs.io/en/latest/protocol.html) to write content to the end of the TextLog. Call [TextLog.clear][textual.widgets.TextLog.clear] to clear the content.
|
||||
|
||||
- [X] Focusable
|
||||
- [ ] Container
|
||||
|
||||
## Example
|
||||
|
||||
The example below shows each placeholder variant.
|
||||
|
||||
=== "Output"
|
||||
|
||||
```{.textual path="docs/examples/widgets/text_log.py" press="_,H,i"}
|
||||
```
|
||||
|
||||
=== "text_log.py"
|
||||
|
||||
```python
|
||||
--8<-- "docs/examples/widgets/text_log.py"
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Reactive Attributes
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| ----------- | ------ | ------- | ------------------------------------------------------------ |
|
||||
| `highlight` | `bool` | `False` | Automatically highlight content. |
|
||||
| `markup` | `bool` | `False` | Apply Rich console markup. |
|
||||
| `max_lines` | `int` | `None` | Maximum number of lines in the log or `None` for no maximum. |
|
||||
| `min_width` | `int` | 78 | Minimum width of renderables. |
|
||||
| `wrap` | `bool` | `False` | Enable word wrapping. |
|
||||
|
||||
## Messages
|
||||
|
||||
This widget sends no messages.
|
||||
|
||||
|
||||
## See Also
|
||||
|
||||
* [TextLog](../api/textlog.md) code reference
|
||||
Reference in New Issue
Block a user