-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuttons.py
57 lines (45 loc) · 2.06 KB
/
buttons.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import streamlit as st
from streamlit_extras.stylable_container import stylable_container
def remove_button(*args, **kwargs):
with stylable_container(
key=kwargs.pop("styleable_key"),
css_styles=f"button {{background-color: IndianRed; color: white; border-radius: 20px; "
f"opacity: {0.5 if kwargs.get('disabled', False) else 1}}}",
):
return st.button(*args, label="Remove", **kwargs)
def browse_button(*args, **kwargs):
kwargs["disabled"] = True
with stylable_container(
key=kwargs.pop("styleable_key"),
css_styles=f"button {{background-color: #FAEBD7; color: black; border-radius: 20px; "
f"opacity: {0.5 if kwargs.get('disabled', False) else 1}}}",
):
return st.button(*args, label="Browse", **kwargs)
def reorder_button(*args, **kwargs):
with stylable_container(
key=kwargs.pop("styleable_key"),
css_styles=f"button {{background-color: LightBlue; color: black; "
f"opacity: {0.5 if kwargs.get('disabled', False) else 1}}}",
):
return st.button(*args, label="Reorder", **kwargs)
def add_button(*args, **kwargs):
with stylable_container(
key=kwargs.pop("styleable_key"),
css_styles=f"button {{background-color: #3CB371; color: white; border-radius: 20px; "
f"opacity: {0.5 if kwargs.get('disabled', False) else 1};}}",
):
return st.button(*args, label="Add", **kwargs)
def save_button(*args, **kwargs):
with stylable_container(
key=kwargs.pop("styleable_key"),
css_styles=f"button {{background-color: #77dd77; color: black; border-radius: 20px; "
f"opacity: {0.5 if kwargs.get('disabled', False) else 1};}}",
):
return st.button(*args, label="Save", **kwargs)
def load_button(*args, **kwargs):
with stylable_container(
key=kwargs.pop("styleable_key"),
css_styles=f"button {{background-color: #aec6cf; color: black; border-radius: 20px; "
f"opacity: {0.5 if kwargs.get('disabled', False) else 1};}}",
):
return st.button(*args, label="Load", **kwargs)