ysharma's picture
ysharma HF staff
Update app.py
25d07a7 verified
import gradio as gr
with gr.Blocks(css=".column-form .wrap {flex-direction: column;}") as demo:
with gr.Row():
with gr.Column(visible=True, min_width=200, scale=0) as sidebar:
options = gr.Radio(["Llama", "Mistral", "Gemma"], label="Model", elem_classes="column-form")
options2 = gr.CheckboxGroup(["Option 1", "Option 2", "Option 3"], label="Option Set 1", elem_classes="column-form")
with gr.Column() as main:
#open_sidebar_btn = gr.Button("Open Sidebar", scale=0)
#close_sidebar_btn = gr.Button("Close Sidebar", visible=False, scale=0)
#open_sidebar_btn.click(lambda: {
# open_sidebar_btn: gr.Button(visible=False),
# close_sidebar_btn: gr.Button(visible=True),
# sidebar: gr.Column(visible=True)
#}, outputs={open_sidebar_btn, close_sidebar_btn, sidebar})
#close_sidebar_btn.click(lambda: {
# open_sidebar_btn: gr.Button(visible=True),
# close_sidebar_btn: gr.Button(visible=False),
# sidebar: gr.Column(visible=False)
#}, outputs={open_sidebar_btn, close_sidebar_btn, sidebar})
#options.select(lambda x: gr.Markdown(value=Seleting the ))
gr.Markdown("# Hello Blocks")
gr.Markdown("## You can keep the Sidebar fixed")
gr.Markdown("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec nulla nec nulla fermentum fermentum. Nullam nec nulla nec nulla fermentum fermentum.")
if __name__ == "__main__":
demo.launch()