Skip to main content

A horizontal control bar component for Gradio UI.

Project description

gradio-horizontal-bar

Static Badge 💻 Component GitHub Code

A versatile, collapsible layout component for Gradio 6 apps using gr.HTML. It allows you to create fixed panels at the top or bottom of the screen that can contain any other Gradio component.

Perfect for floating toolbars, real-time log consoles, settings panels, or secondary navigation bars that stay out of the way until needed.

Features and Key Characteristics

  • Dual-Positioning: Easily switch between top and bottom placement with a single property.
  • Native Container Support: Works as a standard Gradio context manager (with HorizontalBar():), allowing you to nest any Gradio component inside.
  • Gradio 6 Theme Integration: Uses native CSS variables (--background-fill, --color-accent) to match any theme perfectly in Light or Dark mode.

Installation

pip install gradio-horizontal-bar

Usage

Mode 1: Top Floating Toolbar

import gradio as gr
from gradio_horizontal_bar import HorizontalBar

with gr.Blocks() as demo:
    with HorizontalBar(position="top", height=85, open=False):
        with gr.Row():
            gr.Button("▶️ Start Process", variant="primary")
            gr.Button("⏹️ Stop All")
            
    gr.Image("https://picsum.photos/1200/600")
    
demo.launch()

Mode 2: Bottom Log Console (Pre-opened)

import gradio as gr
from gradio_horizontal_bar import HorizontalBar

with gr.Blocks() as demo:
    gr.Markdown("# Main Content Area")
    
    with HorizontalBar(position="bottom", height=250, open=True):
        gr.Markdown("### 📝 System Logs")
        gr.Textbox(lines=8, interactive=False, placeholder="Waiting for logs...")
        
demo.launch()
Property Type Default Description
position Literal["top", "bottom"] "bottom" Where the bar is anchored (top or bottom of the screen).
open bool True Whether the bar starts expanded (True) or collapsed (False).
height int | str 320 Height of the bar (pixels if int, or any CSS unit if str).
width int | str "100%" Width of the bar (horizontally centered).
bring_to_front bool False If True, gives the bar a higher z-index to overlap other sidebars.
rounded_borders bool True Whether to apply rounded corners to the floating edges.
label str | None None Optional label for the component context.
visible bool True Whether the component is visible on the screen.

License

Apache 2.0


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gradio_horizontal_bar-0.0.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gradio_horizontal_bar-0.0.2-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file gradio_horizontal_bar-0.0.2.tar.gz.

File metadata

  • Download URL: gradio_horizontal_bar-0.0.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for gradio_horizontal_bar-0.0.2.tar.gz
Algorithm Hash digest
SHA256 270a5734553de1f653e16c4f966949b9c0a90630ba972b22972f7c751b4c5010
MD5 f106264af8f97e8c913143a7e16086c3
BLAKE2b-256 525e7055b09d583159467a8f75f5f8e6a05e05bd9b850f74f6503388a968e538

See more details on using hashes here.

File details

Details for the file gradio_horizontal_bar-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for gradio_horizontal_bar-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 11b995cc4ac7450d7a4b9a54d48aab12c34fcebf6143042a176840a0f484e451
MD5 ebb71e777d621a316e50e735d4a99e73
BLAKE2b-256 698a824e59d69d4c3683c60736825d712ccb5e3f87dece6fb4d0cef3c09330e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page