Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -7,22 +7,29 @@ def update(input):
|
|
7 |
|
8 |
with gr.Blocks() as demo:
|
9 |
title = gr.HTML("<h1><center>gradio-toggle demo</center></h1>")
|
10 |
-
with gr.
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
input.change(fn=update, inputs=input, outputs=output)
|
28 |
|
|
|
7 |
|
8 |
with gr.Blocks() as demo:
|
9 |
title = gr.HTML("<h1><center>gradio-toggle demo</center></h1>")
|
10 |
+
with gr.Row():
|
11 |
+
shields = gr.HTML('<div style="display: flex; gap: 7px;">
|
12 |
+
<a href="https://pypi.org/project/gradio-toggle/" target="_blank"><img alt="PyPI" src="https://img.shields.io/pypi/v/gradio-toggle"></a>
|
13 |
+
<a href="https://huggingface.co/spaces/dwancin/gradio_toggle" target="_blank"><img alt="Demo" src="https://img.shields.io/badge/%F0%9F%A4%97%20Demo-%23097EFF?style=flat&logoColor=black"></a>
|
14 |
+
<a href="https://github.com/dwancin/gradio-toggle" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/Repository-white?logo=github&logoColor=black"></a>
|
15 |
+
</div>')
|
16 |
+
with gr.Row():
|
17 |
+
description = gr.Markdown("A toggle component that represents a boolean value, allowing users to switch between True and False states. Can function both as an input, to capture user interaction, and as an output, to display a boolean state.")
|
18 |
+
with gr.Row():
|
19 |
+
with gr.Column():
|
20 |
+
input = Toggle(
|
21 |
+
label="Input",
|
22 |
+
value=False,
|
23 |
+
info="Input version of the component",
|
24 |
+
interactive=True,
|
25 |
+
)
|
26 |
+
with gr.Column():
|
27 |
+
output = Toggle(
|
28 |
+
label="Output",
|
29 |
+
value=False,
|
30 |
+
color="green",
|
31 |
+
interactive=False,
|
32 |
+
)
|
33 |
|
34 |
input.change(fn=update, inputs=input, outputs=output)
|
35 |
|