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
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gradio_navbar-0.0.1.tar.gz | 1.2 MB | Without provenance | Details for gradio_navbar-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gradio_navbar-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for gradio_navbar-0.0.1-py3-none-any.whl |
Total release size: 2.3 MB
Security for gradio-navbar 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.