Add gr.ClearButton component demo (#4819)

* add code

* Add notebook

* Fix typos

* Remove css

* Add notebook
This commit is contained in:
Freddy Boulton 2023-07-07 10:51:18 -05:00 committed by GitHub
parent 3208730b06
commit 9b56057a98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -0,0 +1 @@
{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: clearbutton_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "\n", "with gr.Blocks() as demo:\n", " textbox = gr.Textbox(value=\"This is some text\")\n", " gr.ClearButton(textbox)\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}

View File

@ -0,0 +1,9 @@
import gradio as gr
with gr.Blocks() as demo:
textbox = gr.Textbox(value="This is some text")
gr.ClearButton(textbox)
if __name__ == "__main__":
demo.launch()

View File

@ -15,7 +15,7 @@
},
show_label: {
options: [true, false],
description: "Whether to show the gallery",
description: "Whether to show the label",
control: { type: "boolean" },
defaultValue: true
},
@ -45,7 +45,7 @@
},
allow_preview: {
options: [true, false],
description: "Whether to allow a preview view in the gallery",
description: "Whether to allow a preview mode in the gallery",
control: { type: "boolean" },
defaultValue: true
},