-
Notifications
You must be signed in to change notification settings - Fork 223
/
Copy pathradio_check_standalone.py
43 lines (40 loc) · 1.19 KB
/
radio_check_standalone.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
import dash_bootstrap_components as dbc
from dash import Input, Output, html
standalone_radio_check = html.Div(
[
html.Div(
[
dbc.Checkbox(
id="standalone-checkbox",
label="This is a checkbox",
value=False,
),
dbc.Switch(
id="standalone-switch",
label="This is a toggle switch",
value=False,
),
dbc.RadioButton(
id="standalone-radio",
label="This is a radio button",
value=False,
),
]
),
html.P(id="standalone-radio-check-output"),
]
)
@app.callback(
Output("standalone-radio-check-output", "children"),
[
Input("standalone-checkbox", "value"),
Input("standalone-switch", "value"),
Input("standalone-radio", "value"),
],
)
def on_form_change(checkbox_checked, switch_checked, radio_checked):
return (
f"Selections: Checkbox: {checkbox_checked}, "
f"Toggle Switch: {switch_checked}, "
f"Radio Button: {radio_checked}"
)