Add template for widget reference.

This commit is contained in:
Rodrigo Girão Serrão
2023-01-26 10:56:32 +00:00
parent 4405f2da2a
commit 210e39488f

64
docs/widgets/_template.md Normal file
View File

@@ -0,0 +1,64 @@
# Widget
Widget description.
- [ ] Focusable
- [ ] Container
## Example
Example app showing the widget:
=== "Output"
```{.textual path="docs/examples/widgets/checkbox.py"}
```
=== "checkbox.py"
```python
--8<-- "docs/examples/widgets/checkbox.py"
```
=== "checkbox.css"
```sass
--8<-- "docs/examples/widgets/checkbox.css"
```
## Reactive attributes
## Bindings
The WIDGET widget defines directly the following bindings:
::: textual.widgets.WIDGET.BINDINGS
options:
show_root_heading: false
show_root_toc_entry: false
## Component classes
The WIDGET widget provides the following component classes:
::: textual.widget.WIDGET.COMPONENT_CLASSES
options:
show_root_heading: false
show_root_toc_entry: false
## Additional notes
- Did you know this?
- Another pro tip.
## See also
- [WIDGET](../api/WIDGET.md) code reference.
- Another related API.
- Something else useful.