Custom Components GalleryNEW
ExploreCustom Components GalleryNEW
ExploreNew to Gradio? Start here: Getting Started
See the Release History
@gr.render(inputs=···)
def hello(···):
...
inputs=
argument of @gr.render, and create a corresponding argument in your function for each component. import gradio as gr
with gr.Blocks() as demo:
input_text = gr.Textbox()
@gr.render(inputs=input_text)
def show_split(text):
if len(text) == 0:
gr.Markdown("## No Input Provided")
else:
for letter in text:
with gr.Row():
text = gr.Textbox(letter)
btn = gr.Button("Clear")
btn.click(lambda: gr.Textbox(value=""), None, text)
Parameter | Description |
---|---|
inputs list[Component] | None default: None | List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list. |
triggers list[EventListener] | EventListener | None default: None | List of triggers to listen to, e.g. [btn.click, number.change]. If None, will listen to changes to any inputs. |
queue bool default: True | If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app. |
trigger_mode Literal[('once', 'multiple', 'always_last')] | None default: "always_last" | If "once" (default for all events except |
concurrency_limit int | None | Literal['default'] default: None | If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the |
concurrency_id str | None default: None | If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit. |