Files
textual/tests/snapshot_tests/snapshot_apps/auto_width_input.py
Will McGugan 330db5fc80 snapshot
2023-01-31 12:43:07 +01:00

27 lines
537 B
Python

from textual.app import App, ComposeResult
from textual.containers import Vertical
from textual.widgets import Header, Footer, Label, Input
class InputWidthAutoApp(App[None]):
CSS = """
Screen {
align: center middle;
}
Input.auto {
width: auto;
max-width: 100%;
}
"""
def compose(self) -> ComposeResult:
yield Header()
yield Input(placeholder="This has auto width", classes="auto")
yield Footer()
if __name__ == "__main__":
InputWidthAutoApp().run()