Skip to main content

Gradio custom compnent for adding URL buttons

Project description

gradio_url_buttons

PyPI - Version

Gradio custom compnent for adding URL buttons

Installation

pip install gradio_url_buttons

Usage

import gradio as gr
from gradio_url_buttons import source_buttons

def add_source():
    return [{"link": "https://www.github.com", "hostname": "Github.com"}, {"link": "https://www.hkk.de", "hostname": "HKK.de"}]

with gr.Blocks() as demo:
    gr.Markdown("# Change the value (keep it JSON) and the front-end will update automatically.")
    source_buttons(value=[])
    buttons = source_buttons()
    click = gr.Button("Click me")
    source_buttons(value=[{"link": "https://www.google.com", "hostname": "Google.com"}, {"link": "https://www.hkk.de", "hostname": "HKK.de"}])

    click.click(add_source, inputs=[], outputs=[buttons])


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

source_buttons

Initialization

name type default description
value
Any
None None
label
str | None
None None
info
str | None
None None
show_label
bool | None
None None
container
bool
True None
scale
int | None
None None
min_width
int | None
None None
interactive
bool | None
None None
visible
bool
True None
elem_id
str | None
None None
elem_classes
list[str] | str | None
None None
render
bool
True None
load_fn
Callable | None
None None
every
float | None
None None

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_url_buttons-0.0.2.tar.gz (51.1 kB view details)

Uploaded Source

Built Distribution

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

gradio_url_buttons-0.0.2-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gradio_url_buttons-0.0.2.tar.gz
  • Upload date:
  • Size: 51.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for gradio_url_buttons-0.0.2.tar.gz
Algorithm Hash digest
SHA256 fefe961be60dc20eb67f70941c1601f506aea2b24e5009e8558b5ca7c8251e9d
MD5 c93a93c43fe8f87a73bcc75105d9157b
BLAKE2b-256 e0b2080e13a93179d2dc12b0ac3a695ba4c2fd6a0d39095bc192c36e177cac92

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gradio_url_buttons-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3c77b86a4c2e1a58911b2adf1f73646595975cd3130cfcf78cbc82e27b9bb4f8
MD5 6df8513cb37b2995482b4d5da6d2eb44
BLAKE2b-256 8e9b39d93bcf3379ba976bc0464b7979b073c49e60019d6be0f8e1a089128db8

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