A select widget (aka dropdown) for Textual.
Project description
Textual: Select
A simple select widget (aka dropdown) for textual with an optional search field.
Usage
from textual_select import Select
dropdown_data = [
{"value": 0, "text": "Pick-Up"},
{"value": 1, "text": "SUV"},
{"value": 2, "text": "Hatchback"},
{"value": 3, "text": "Crossover"},
{"value": 4, "text": "Convertible"},
{"value": 5, "text": "Sedan"},
{"value": 6, "text": "Sports Car"},
{"value": 7, "text": "Coupe"},
{"value": 8, "text": "Minivan"}
]
Select(
placeholder="please select",
items=dropdown_data,
list_mount="#main_container"
)
Installation
pip install textual-select
Requires textual 0.6.0 or later.
Limitations
This textual widget is in early stage and has some limitations:
- It needs a specific mount point (
list_mount
) where the dropdown list shall appear. This is needed because the container widget with the select itself could be too small. Maybe in future versions this will no longer needed. - It can only open below, not above: Make sure to reserve space below the dropdown.
- The dropdown list has a fixed height of 5 entries. This will be configurable in future versions.
Similar Widgets
- If you are looking for an autocomplete, please refer to textual-autocomplete by Darren Burns.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
textual_select-0.2.2.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for textual_select-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 037cf599568487ca0c732d3abf1219fc35b7018617a92d2bf8d74070fdde9cdc |
|
MD5 | a8ecb548c02b454b921a38b81426de20 |
|
BLAKE2b-256 | 3b371602d2247deb46d3fd844718f27edd978c06add90b214c4dcaa6947c3b99 |