Skip to main content

Python library for easily interacting with trained machine learning models

Project description

gradio_goodtabs

PyPI - Version

Python library for easily interacting with trained machine learning models

Installation

pip install gradio_goodtabs

Usage

import gradio as gr
from gradio_goodtabs import GoodTabs
from gradio_goodtab import GoodTab as Tab
# from gradio_goodtabs import GoodTab as Tab
# gr.Tab = Tab
gr.Tabs = GoodTabs

with gr.Blocks() as demo:
    with gr.Row():
        with GoodTabs():  
            with Tab("Tab 1 long long long long long long long long long"):
                gr.Textbox(value="foo", interactive=True)
            with Tab("Tab 1 long long long long long long long long long"):
                gr.Textbox(value="foo", interactive=True)
            with Tab("Tab 1 long long long long long long long long long"):
                gr.Textbox(value="foo", interactive=True)
            with Tab("Tab 1 long long long long long long long long long"):
                gr.Textbox(value="foo", interactive=True)
            with Tab("Tab 1 long long long long long long long long long"):
                gr.Textbox(value="foo", interactive=True)
            with Tab("Tab 1 long long long long long long long long long"):
                gr.Textbox(value="foo", interactive=True)
            with Tab("Tab 1 long long long long long long long long long"):
                gr.Textbox(value="foo", interactive=True)
            with Tab("Tab 1 long long long long long long long long long"):
                gr.Textbox(value="foo", interactive=True)
            with Tab("Tab 1 long long long long long long long long long"):
                gr.Textbox(value="foo", interactive=True)
            with Tab("Tab 1 long long long long long long long long long"):
                gr.Textbox(value="foo", interactive=True)
            with Tab("Tab 1 long long long long long long long long long"):
                gr.Textbox(value="foo", interactive=True)
            with Tab("Tab 1 long long long long long long long long long"):
                gr.Textbox(value="foo", interactive=True)
            # with gr.Tab("Tab 1 long long long long long long long long long"):
            #     gr.Textbox(value="foo", interactive=True)
            # with gr.Tab("Tab 1 long long long long long long long long long"):
            #     gr.Textbox(value="foo", interactive=True)
            # with gr.Tab("Tab 1 long long long long long long long long long"):
            #     gr.Textbox(value="foo", interactive=True)
            # with gr.Tab("Tab 1 long long long long long long long long long"):
            #     gr.Textbox(value="foo", interactive=True)
            # with gr.Tab("Tab 1 long long long long long long long long long"):
            #     gr.Textbox(value="foo", interactive=True)
            # with gr.Tab("Tab 1 long long long long long long long long long"):
            #     gr.Textbox(value="foo", interactive=True)
            # with gr.Tab("Tab 2"):
            #     gr.Number(value=10, interactive=True)


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

GoodTab

Initialization

name type default description
label
str | None
None The visual label for the tab
visible
bool
True If False, Tab will be hidden.
interactive
bool
True If False, Tab will not be clickable.
id
int | str | None
None An optional identifier for the tab, required if you wish to control the selected tab from a predict function.
elem_id
str | None
None An optional string that is assigned as the id of the
containing the contents of the Tab layout. The same string followed by "-button" is attached to the Tab button. Can be used for targeting CSS styles.
elem_classes
list[str] | str | None
None An optional string or list of strings that are assigned as the class of this component in the HTML DOM. Can be used for targeting CSS styles.
render
bool
True If False, this layout will not be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
key
str | None
None Added for new gradio compatibility, has no effect for now.

Events

name description
select Event listener for when the user selects or deselects the GoodTab. Uses event data gradio.SelectData to carry value referring to the label of the GoodTab, and selected to refer to state of the GoodTab. See EventData documentation on how to use this event data

GoodTabs

Initialization

name type default description
selected
int | str | None
None The currently selected tab. Must correspond to an id passed to the one of the child TabItems. Defaults to the first TabItem.
visible
bool
True If False, GoodTabs 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 string or list of strings that are assigned as the class of this component in the HTML DOM. Can be used for targeting CSS styles.
render
bool
True If False, this layout will not be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
key
str | None
None Added for new gradio compatibility, has no effect for now.

Events

name description
change Triggered when the value of the GoodTabs changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See .input() for a listener that is only triggered by user input.
select Event listener for when the user selects or deselects the GoodTabs. Uses event data gradio.SelectData to carry value referring to the label of the GoodTabs, and selected to refer to state of the GoodTabs. See EventData documentation on how to use this event data

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_goodtabs-0.0.5.tar.gz (53.0 kB view details)

Uploaded Source

Built Distribution

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

gradio_goodtabs-0.0.5-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file gradio_goodtabs-0.0.5.tar.gz.

File metadata

  • Download URL: gradio_goodtabs-0.0.5.tar.gz
  • Upload date:
  • Size: 53.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for gradio_goodtabs-0.0.5.tar.gz
Algorithm Hash digest
SHA256 891cd29ae4c7c2d576ac9479bdd28723b43e906915f7438a7e5ad22beafb62a0
MD5 2937b5d420048fee8b24234ab32e9c78
BLAKE2b-256 8666a2b7fc5fc8233fd563dfa18c28a09af04773049c65824288b0d4a7be90be

See more details on using hashes here.

File details

Details for the file gradio_goodtabs-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for gradio_goodtabs-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 713ae7772beee1f6d9a827e42a7e96253c9c75b81ab498589d7792b4ceb1547b
MD5 85557f2618fd97990108fa3c4df70946
BLAKE2b-256 93a20aca858c20a6d48e4451ce755cffcea635994897d0cc69d14388b65e301d

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