Streamlit keyboard shortcuts for your buttons.
Project description
Streamlit Shortcuts
Streamlit Shortcuts allows you to easily add keyboard shortcuts to your Streamlit buttons.
Installation
pip install streamlit-shortcuts
Example
import streamlit as st
from streamlit_shortcuts import add_keyboard_shortcuts
def delete_callback():
st.write("DELETED!")
st.button("delete", on_click=delete_callback)
add_keyboard_shortcuts({
'Ctrl+Shift+X': 'delete',
# Add more key-button mappings here
})
The 'Ctrl+Shift+X' combination will trigger "Another Button".
Keys
- Modifiers: 'Control', 'Shift', 'Alt'
- Common Keys: 'Enter', 'Escape', 'Space'
- Arrow Keys: 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'
Examples of Key Combinations:
- 'Control+Enter'
- 'Shift+ArrowUp'
- 'Alt+Space'
For a complete list of key values, refer to: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values
Contributing
Contributions are welcome! If you have suggestions for improvements or bug fixes, please feel free to make a pull request or open an issue.
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
Close
Hashes for streamlit-shortcuts-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4da1ea6589414cd2285b4e4f1116b059d975ed4bf682bd750c817659f89113c |
|
MD5 | 084705061b55966f1d7c67796b2a07d8 |
|
BLAKE2b-256 | c2d881093181454c9234ab26871fca80ff91d3b32e47f7f74238d5454854d447 |
Close
Hashes for streamlit_shortcuts-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87821a4b7b0f3085aa5cfba5ab8333bac2dc95301016daab1d6f38c8e62600d3 |
|
MD5 | c6947eb28484c24ae1064d32167b421a |
|
BLAKE2b-256 | 2e9d7940e0dfe5839143a6c025134784ed950f2545c131bfbaef938f9225c782 |