sanatan_ai / app3.py
vikramvasudevan's picture
Upload folder using huggingface_hub
f12accf verified
raw
history blame contribute delete
442 Bytes
import gradio as gr
def collapse_sidebar():
# return a config change for the Sidebar component
return gr.update(open=False)
with gr.Blocks() as demo:
with gr.Sidebar() as sidebar:
gr.Markdown("Sidebar content")
close_btn = gr.Button("Close sidebar")
# clicking the button tells Gradio to update the Sidebar's 'open' prop
close_btn.click(fn=collapse_sidebar, inputs=None, outputs=sidebar)
demo.launch()