Skip to content

Commit

Permalink
add demo site with more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
javierluraschi committed Mar 4, 2024
1 parent 561a321 commit 101d792
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 7 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

Modern frontend components based on [Bulma](https://bulma.io/) and [Buefy](https://buefy.org/) for [Streamlit](https://streamlit.io/).

![](images/streamfy.gif)
[![](images/streamfy.gif)](https://streamfy.streamlit.app/)

Live demo at [streamfy.streamlit.app](https://streamfy.streamlit.app/)

## Getting Started

Expand Down
41 changes: 37 additions & 4 deletions examples/all.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
import streamlit as st
import streamfy as sy

st.title("Streamfy — Bulma for Streamlit")
st.write("""
This gallery showcases modern controls implemented in https://github.com/hal9ai/streamfy
""")

st.subheader("Breadcrumb")
item = sy.breadcrumb(items=[{"text": "A"}, {"text": "B"}])
st.write(item)

st.subheader("Button")
if sy.button(text = "Click!"):
if sy.button(text = "Primary", type="is-primary"):
st.write("Clicked!")

sy.button(text = "Primary Light", type="is-primary is-light")
sy.button(text = "Success", type="is-success")
sy.button(text = "Success Light", type="is-success is-light")
sy.button(text = "Danger", type="is-danger")
sy.button(text = "Danger Light", type="is-danger is-light")
sy.button(text = "Warning", type="is-warning")
sy.button(text = "Warning Light", type="is-warning is-light")
sy.button(text = "Info", type="is-info")
sy.button(text = "Info Light", type="is-info is-light")
sy.button(text = "Link", type="is-link")
sy.button(text = "Link Light", type="is-link is-light")
sy.button(text = "Light", type="is-light")
sy.button(text = "Ghost", type="is-ghost")

st.subheader("Carousel")
selection = sy.carousel(items=[
"https://picsum.photos/id/1051/1230/500",
Expand All @@ -22,9 +41,14 @@
st.write(complete)

st.subheader("Checkbox")
checked = sy.checkbox(text = "Check me")
checked = sy.checkbox(text="Check me")
st.write(checked)

sy.checkbox(text="Info", type="is-info", default=True)
sy.checkbox(text="Success", type="is-success", default=True)
sy.checkbox(text="Danger", type="is-danger", default=True)
sy.checkbox(text="Warning", type="is-warning", default=True)

st.subheader("Clockpicker")
clock = sy.clockpicker()
st.write(clock)
Expand All @@ -38,8 +62,17 @@
st.write(datepick)

st.subheader("Input")
email = sy.input(type="email", icon="email", default="john@", maxlength="30")
st.write(email)
text = sy.input()
st.write(text)

sy.input(type="email", icon="email", default="john@", maxlength="30")
sy.input(type="is-success", maxlength="30")
sy.input(type="password", value="iwantmytreasure", password_reveal=True)
sy.input(type="textarea", maxlength="200")
sy.input(label="Success", type="is-success")
sy.input(label="Error", type="is-danger")
sy.input(label="Info", type="is-info")
sy.input(label="Warning", type="is-warning")

st.subheader("Numberinput")
number = sy.numberinput(placeholder="10", min="5")
Expand Down
31 changes: 29 additions & 2 deletions streamfy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,20 @@ def table(**kwargs):
if button(text = "Click!"):
st.write("Clicked!")

button(text = "Primary Light", type="is-primary is-light")
button(text = "Success", type="is-success")
button(text = "Success Light", type="is-success is-light")
button(text = "Danger", type="is-danger")
button(text = "Danger Light", type="is-danger is-light")
button(text = "Warning", type="is-warning")
button(text = "Warning Light", type="is-warning is-light")
button(text = "Info", type="is-info")
button(text = "Info Light", type="is-info is-light")
button(text = "Link", type="is-link")
button(text = "Link Light", type="is-link is-light")
button(text = "Light", type="is-light")
button(text = "Ghost", type="is-ghost")

st.subheader("Carousel")
selection = carousel(items=[
"https://picsum.photos/id/1051/1230/500",
Expand All @@ -163,6 +177,11 @@ def table(**kwargs):
checked = checkbox(text = "Check me")
st.write(checked)

checkbox(text="Info", type="is-info", default=True)
checkbox(text="Success", type="is-success", default=True)
checkbox(text="Danger", type="is-danger", default=True)
checkbox(text="Warning", type="is-warning", default=True)

st.subheader("Clockpicker")
clock = clockpicker()
st.write(clock)
Expand All @@ -176,8 +195,16 @@ def table(**kwargs):
st.write(datepick)

st.subheader("Input")
email = input(type="email", icon="email", default="john@", maxlength="30")
st.write(email)
text = input()
st.write(text)
input(type="email", icon="email", default="john@", maxlength="30")
input(type="is-success", maxlength="30")
input(type="password", value="iwantmytreasure", password_reveal=True)
input(type="textarea", maxlength="200")
input(label="Success", type="is-success")
input(label="Error", type="is-danger")
input(label="Info", type="is-info")
input(label="Warning", type="is-warning")

st.subheader("Numberinput")
number = numberinput(placeholder="10", min="5")
Expand Down

0 comments on commit 101d792

Please sign in to comment.