adriangalilea / streamlit-shortcuts

Streamlit keyboard shortcuts for your buttons.
MIT License
21 stars 4 forks source link

add keyboard tooltip to button (streamlit-extras) #3

Closed github-actions[bot] closed 4 months ago

github-actions[bot] commented 4 months ago

https://github.com/adriangalilea/streamlit-shortcuts/blob/bfca99129ff68cb85987673cfe24d73d2da552c0/src/streamlit_shortcuts/streamlit_shortcuts.py#L4


import streamlit.components.v1 as components

# TODO bump to v0.1.2 for 'Meta modifier'
# TODO add keyboard tooltip to button (streamlit-extras)
# TODO improve usage ergonomics

def add_keyboard_shortcuts(key_combinations: dict[str, str]):
    """
adriangalilea commented 4 months ago

https://arnaudmiribel.github.io/streamlit-extras/extras/keyboard_text/

It'd be great if button showed this kind of hint inside, not sure how feasible is it, but it would greatly improve UX, should probably be optional.

streamlit_shortcuts.button("delete", on_click=delete_callback, shortcut="Ctrl+Shift+X", hint=True)
github-actions[bot] commented 4 months ago

Closed in eb0ca95d8a776f76b5e1f8db2f2879f418264474