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.0.tar.gz
(6.0 kB
view details)
Built Distribution
File details
Details for the file textual_select-0.2.0.tar.gz
.
File metadata
- Download URL: textual_select-0.2.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/5.15.0-56-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccdc35df0fb5a263aa597dc19d0c24337129166d6dc369788127e30cfb855ee4 |
|
MD5 | ecd82e172ed28fc173665e2920acaf09 |
|
BLAKE2b-256 | 3243c7937a034140bba97a4e44ea3f8e181fc383748e68a5127da36f6c4ecca9 |
File details
Details for the file textual_select-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: textual_select-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/5.15.0-56-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4203c1865f227a180e9b921df0131169861c50f661a00f52cb78b06c8f2c40be |
|
MD5 | 87fb5366dc49d9e5c5fdf2d065dd0890 |
|
BLAKE2b-256 | e6b7f341a7d9f50db8a97960800a19bf523b9f9f75cd6e7b8531eca3d5965ca6 |