A Textual widget for a simple slider
Project description
textual-slider
A Textual widget for a simple slider.
Installation
Install textual-slider using pip:
pip install textual-slider
Usage
textual-slider provides a simple Slider widget for use in
Textual, that allows selecting an
integer value within a given range.
The initial value of the slider if not specified is the minimum value. You can also optionally specify a step size between valid values.
yield Slider(0, 10)
yield Slider(min=200, max=500, step=100, value=300)
You can find more complete usage examples of the Slider widget in the
/examples/ directory of this repo.
Limitations
Textual apps run in the terminal, which work in terms of character cells rather than pixels. This means you obviously can't have the same fine-grained control for this slider as usual, depending on the size of the slider range and the styled width.
Currently this slider widget only works with integer values. Any suggestions for how to work with floating point values would be welcome!
Contributing
I created this simple slider widget as a learning exercise to better understand Textual and it is still a work in progress.
I'd really appreciate any feedback or suggestions, but I'm afraid I probably won't be accepting any PRs at the moment.
Licence
Licensed under the GNU General Public License v3.0.
Project details
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_slider-0.2.0.tar.gz.
File metadata
- Download URL: textual_slider-0.2.0.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdf28cc764ff1163a2f03655a31253a2c4b4966ddff3d0de53c4df10593277c7
|
|
| MD5 |
31bb03cc09b80028e81f09e3d15a02f0
|
|
| BLAKE2b-256 |
40aa2019bbb5218e4c3461248281cef0a1dbc827995ba940a6fb1f929e34725d
|
File details
Details for the file textual_slider-0.2.0-py3-none-any.whl.
File metadata
- Download URL: textual_slider-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e36f33bae5cfe968deeb5c61880c76c6a66448ee733683bd74d73c93825d4e6
|
|
| MD5 |
601ab957032b739f90f00b5bed34f28e
|
|
| BLAKE2b-256 |
23f39faea1513c81a1efd9c16f71ed1d72e6645032d07c82b3b01f1967e2d6fa
|