mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
24 lines
516 B
Python
24 lines
516 B
Python
from textual.app import App, ComposeResult
|
|
from textual.suggester import SuggestFromList
|
|
from textual.widgets import Input
|
|
|
|
|
|
fruits = ["apple", "pear", "mango", "peach", "strawberry", "blueberry", "banana"]
|
|
|
|
|
|
class FruitsApp(App[None]):
|
|
CSS = """
|
|
Input > .input--suggestion {
|
|
color: red;
|
|
text-style: italic;
|
|
}
|
|
"""
|
|
|
|
def compose(self) -> ComposeResult:
|
|
yield Input("straw", suggester=SuggestFromList(fruits))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app = FruitsApp()
|
|
app.run()
|