mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-17 11:29:58 +08:00
Add gr.ClearButton component demo (#4819)
* add code * Add notebook * Fix typos * Remove css * Add notebook
This commit is contained in:
parent
3208730b06
commit
9b56057a98
1
demo/clearbutton_component/run.ipynb
Normal file
1
demo/clearbutton_component/run.ipynb
Normal 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}
|
9
demo/clearbutton_component/run.py
Normal file
9
demo/clearbutton_component/run.py
Normal 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()
|
@ -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
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user