diff --git a/README.md b/README.md index 07543f4..5270deb 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/examples/all.py b/examples/all.py index e549111..cc90cc8 100644 --- a/examples/all.py +++ b/examples/all.py @@ -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", @@ -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) @@ -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") diff --git a/streamfy/__init__.py b/streamfy/__init__.py index 60ad3cf..be46b83 100644 --- a/streamfy/__init__.py +++ b/streamfy/__init__.py @@ -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", @@ -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) @@ -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")