mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add docs for Placeholder.
This commit is contained in:
39
docs/examples/widgets/placeholder.py
Normal file
39
docs/examples/widgets/placeholder.py
Normal file
@@ -0,0 +1,39 @@
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.containers import Container, Horizontal, Vertical
|
||||
from textual.widgets import Placeholder
|
||||
|
||||
|
||||
class PlaceholderApp(App):
|
||||
|
||||
CSS_PATH = "placeholder.css"
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Vertical(
|
||||
Container(
|
||||
Placeholder(label="This is a custom label for p1.", id="p1"),
|
||||
Placeholder(label="Placeholder p2 here!", id="p2"),
|
||||
Placeholder(id="p3"),
|
||||
Placeholder(id="p4"),
|
||||
Placeholder(id="p5"),
|
||||
Placeholder(),
|
||||
Horizontal(
|
||||
Placeholder("size", id="col1"),
|
||||
Placeholder("text", id="col2"),
|
||||
Placeholder("size", id="col3"),
|
||||
id="c1",
|
||||
),
|
||||
id="bot"
|
||||
),
|
||||
Container(
|
||||
Placeholder("text", id="left"),
|
||||
Placeholder("size", id="topright"),
|
||||
Placeholder("text", id="botright"),
|
||||
id="top",
|
||||
),
|
||||
id="content",
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = PlaceholderApp()
|
||||
app.run()
|
||||
Reference in New Issue
Block a user