A select widget (aka dropdown) for Textual.
Project description
Textual: Select
IMPORTANT: Since version 0.24.0 Textual implemented a native dropdown. I strongly recommend to use the native version. This repository will slowly die. More information at the Blog Post about Select control.
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.11.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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file textual_select-0.3.4.tar.gz.
File metadata
- Download URL: textual_select-0.3.4.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/5.19.0-43-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae6767bb9078d2e451caf8f1606785cc9e99037f509a714942fe15660aeaa3e3
|
|
| MD5 |
707d172eb2a29c5b59ae60eea689cf85
|
|
| BLAKE2b-256 |
23484c1ad7e5190908f7b8083584e78534a79cb538d9ce38486a5c69e514b221
|
File details
Details for the file textual_select-0.3.4-py3-none-any.whl.
File metadata
- Download URL: textual_select-0.3.4-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/5.19.0-43-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b315dd041178f95c20000bab4358d49abae4c46fb222c9ec71eebe11d9e3a88
|
|
| MD5 |
d50862e82f2aa55edd1fff0f7bb5f6d1
|
|
| BLAKE2b-256 |
9b834f1505180b391a6c9878ab1c55ed25dbd0ec838766ef776a04bffdb42ac9
|