Skip to main content

tags: [gradio-custom-component, SimpleTextbox, gradio, navbar, navar-component, gradio-navbar, UI-component] title: gradio_navbar short_description: Gradio custom navbar component colorFrom: blue colorTo: yellow sdk: gradio pinned: false app_file: space.py

gradio_navbar

Static Badge Static Badge

Gradio custom navbar component

Installation

pip install gradio_navbar

Usage

"""
Demo for the NavBar component.
"""

import gradio as gr
from gradio_navbar import NavBar


example = NavBar().example_value()

demo = gr.Interface(
    lambda x: x,
    [
        NavBar(
            value={
                "company_logo_url": "https://avatars.githubusercontent.com/u/\
55248617?v=4",
                "company_name": "Gradio",
                "logout_link": "https://www.gradio.app",
                "username": "gradio",
                "profile_photo_url": "https://avatars.githubusercontent.com/u/\
55248607?v=4",
            }
        ),
    ],  # interactive version of your component
    NavBar(),  # static version of your component
    examples=[
        [example]
    ],  # uncomment this line to view the "example version" of your component
)


if __name__ == "__main__":
    demo.launch()

NavBar

Initialization

name type default description
value
Dict[str, Any] | Callable | None
None None
every
Timer | float | None
None Continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.
inputs
Component | Sequence[Component] | set[Component] | None
None Components that are used as inputs to calculate `value` if `value` is a function (has no effect otherwise). `value` is recalculated any time the inputs change.
visible
bool
True If False, component will be hidden.
elem_id
str | None
None An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
elem_classes
list[str] | str | None
None An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
render
bool
True If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
key
int | str | None
None if assigned, will be used to assume identity across a re-render. Components that have the same key across a re-render will have their value preserved.

User function

The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).

  • When used as an Input, the component only impacts the input signature of the user function.
  • When used as an output, the component only impacts the return signature of the user function.

The code snippet below is accurate in cases where the component is used as both an input and an output.

  • As output: Is passed, passes text value as a {str} into the function.
  • As input: Should return, expects a {str} returned from function and sets textarea value to it.
def predict(
    value: typing.Optional[typing.Dict[str, typing.Any]][
   typing.Dict[str, typing.Any][str, typing.Any], None
]
) -> typing.Optional[typing.Dict[str, typing.Any]][
   typing.Dict[str, typing.Any][str, typing.Any], None
]:
    return value

Metadata

Release files for gradio-navbar 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gradio-navbar 0.0.1
File Size Uploaded
gradio_navbar-0.0.1.tar.gz 1.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for gradio-navbar 0.0.1
File Interpreter ABI Platform
gradio_navbar-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 2.3 MB

Release files / gradio_navbar-0.0.1.tar.gz

Download URL gradio_navbar-0.0.1.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
5e58fab12349c5ed44373a21ec0e7a761047dfcfff904e809a4935c3676ca270
BLAKE2b-256 checksum
How to use checksums
60133186d17c3634ab3a049bad628eec112f5e537a369e686034f8275c710303
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Release files / gradio_navbar-0.0.1-py3-none-any.whl

Download URL gradio_navbar-0.0.1-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f8cfc1b7fba2b3c188e32c51a5f6ad65990abe99675bf7b5400cb81a13908e64
BLAKE2b-256 checksum
How to use checksums
74ed0ceea9d096f5262219451124ffe2eb90e44aa9397248eb7793e2ff2e4c7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page