Skip to content

Commit

Permalink
chore: bump version v0.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
adriangalilea committed Sep 2, 2024
1 parent 858aa62 commit 74061f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,28 @@ pip install streamlit-shortcuts

## Example

⭐ New in v0.1.9: Simplified usage and example.py
⭐ New in v0.1.9:

Check out the `example.py` file in the repository for a complete working example. Here's a snippet:
- More robust logic.
- Simplified usage.
- Bug fixes.
- New [`example.py`](./example.py) for easy testing after pulling (change import path if installed)

Check out the `example.py` file in the repository for a complete working example. Here's a different snippet:

```python
import streamlit as st
from streamlit_shortcuts import button, add_keyboard_shortcuts

# Example 1: Simple button with shortcut
if button("Click me!", "ctrl+shift+c", lambda: st.success("Button clicked!"), hint=True):
st.write("Button was clicked")

# Example 2: Multiple shortcuts
add_keyboard_shortcuts({
"ctrl+shift+s": "Save",
"ctrl+shift+o": "Open"
})

# Example 3: Button with arguments
def greet(name):
st.success(f"Hello, {name}!")

button("Greet", "ctrl+shift+g", greet, hint=True, args=("World",))

# Using a lambda
if button("Click me!", "ctrl+shift+c", lambda: st.success("Button clicked!"), hint=True):
st.write("Button was clicked")

```

To run the example, clone the repository and execute:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.8
0.1.9

0 comments on commit 74061f0

Please sign in to comment.