> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/gradio-app/gradio/llms.txt
> Use this file to discover all available pages before exploring further.

# Button

> Create clickable buttons in Gradio

The Button component creates a clickable button that triggers events.

## Basic usage

```python theme={null}
import gradio as gr

def greet():
    return "Hello!"

with gr.Blocks() as demo:
    output = gr.Textbox()
    btn = gr.Button("Click me")
    btn.click(fn=greet, outputs=output)
    
demo.launch()
```

## Constructor

<ParamField path="value" type="str | Callable" default="'Run'">
  Button label text
</ParamField>

<ParamField path="variant" type="Literal['primary', 'secondary', 'stop', 'huggingface']" default="'secondary'">
  Button style:

  * `"primary"` - Main call-to-action
  * `"secondary"` - Subdued style
  * `"stop"` - Stop button
  * `"huggingface"` - HF branded style
</ParamField>

<ParamField path="size" type="Literal['sm', 'md', 'lg']" default="'lg'">
  Button size
</ParamField>

<ParamField path="icon" type="str | Path | None" default="None">
  URL or path to icon file to display
</ParamField>

<ParamField path="link" type="str | None" default="None">
  URL to open when clicked
</ParamField>

<ParamField path="link_target" type="Literal['_self', '_blank', '_parent', '_top']" default="'_self'">
  Where to open the linked URL
</ParamField>

<ParamField path="interactive" type="bool" default="True">
  Whether button is clickable
</ParamField>

## Events

* **click** - Triggered when button is clicked

## Examples

### Primary button

```python theme={null}
import gradio as gr

btn = gr.Button("Submit", variant="primary")
```

### With icon

```python theme={null}
import gradio as gr

btn = gr.Button(
    "Download",
    icon="https://huggingface.co/favicon.ico"
)
```

### As link

```python theme={null}
import gradio as gr

btn = gr.Button(
    "Visit Gradio",
    link="https://gradio.app",
    link_target="_blank"
)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.