Skip to content

Add show_label property to gr.Sidebar #11295

Open
@ExcellentAmericanEagle

Description

@ExcellentAmericanEagle
  • I have searched to see if a similar issue already exists.

Is your feature request related to a problem? Please describe.
Currently, the label passed to gr.Sidebar isn't visible by design. As documented:

label: name of the sidebar. Not displayed to the user.

This is a weird built in behavior because normally in other gradio components the label is always rendered to the user in some way.

Describe the solution you'd like
I suggest adding show_label property to gr.Sidebar that's set to False by default (to preserve current behavior). Setting this to True will render the label next to the arrow in the sidebar toggle button only when the sidebar is closed

with gr.Sidebar(label="Errors (2)", open=True, width=300, show_label=True):

Collapsed:

Image

Expanded:

Image

Additional context
Currently there can only be a single gr.Sidebar instance that takes effect in the system.
Adding labels to the toggle button is one step ahead for supporting multiple gr.Sidebars.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions