import gradio as gr
from gradio_banner import Banner
with gr.Blocks(css=".main{max-width: 700px;margin: 40px auto;}") as demo:
with gr.Row():
title = gr.HTML("
gradio_banner demo
")
with gr.Row():
shields = gr.HTML('')
with gr.Row():
description = gr.Markdown("A banner component for displaying important information, alerts, notifications, and types of messages within a Gradio Blocks.")
with gr.Row():
Banner(value="Large info banner *with* **markdown** `value`", variant="info")
with gr.Row():
Banner(variant="success", size="sm")
with gr.Row():
Banner(value="Large warning banner with default label and specified value", variant="warning")
with gr.Row():
Banner(variant="error", show_close_button=True)
with gr.Row():
with gr.Column():
with gr.Row():
Banner(value="Small info banner with close button and without label", size="sm", show_close_button=True, show_label=False)
with gr.Row():
Banner(label="Custom label and icon", value="Large info banner with custom icon", icon="https://i.pinimg.com/originals/e9/ab/30/e9ab30fdcadf40bdc095a1e317f3851c.gif")
with gr.Column():
Banner(value="Large success banner with specified value", variant="success")
if __name__ == "__main__":
demo.launch()