Spaces:
Running
Running
from gradio import components as gc | |
import gradio as gr | |
# Create a sidebar component | |
sidebar = gc.SideBar() | |
for item in sidebar_items: | |
prompt_button = gc.Button(text=item["prompt"]) | |
description = item["description"] | |
# Add additional styling or functionality if needed | |
# Append the button and description to the sidebar component | |
sidebar.append(prompt_button, description) | |
# Create the interface without a sidebar (since we've added it separately) | |
iface = gr.Interface( | |
fn=greet, | |
inputs="text", | |
outputs="text", | |
title="Greeting App", | |
description="Ask a user for their name and greet them." | |
) | |
# Add the left sidebar to the interface | |
iface.add_component(sidebar, side="left") | |
# Launch the Gradio app | |
iface.launch() | |