> ## 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.

# Dropdown

> Create dropdown selection components in Gradio

The Dropdown component allows users to select one or multiple options from a dropdown menu.

## Basic usage

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

def greet(name):
    return f"Hello {name}!"

gr.Interface(
    fn=greet,
    inputs=gr.Dropdown(["Alice", "Bob", "Charlie"]),
    outputs=gr.Textbox()
).launch()
```

## Constructor

<ParamField path="choices" type="Sequence[str | int | float | tuple] | None" default="None">
  List of options. Can be simple values or tuples of (label, value)
</ParamField>

<ParamField path="value" type="str | int | float | list | Callable | None" default="None">
  Default selected value(s). If None with single select, first choice is selected
</ParamField>

<ParamField path="type" type="Literal['value', 'index']" default="'value'">
  Return type:

  * `"value"` - Returns selected value(s)
  * `"index"` - Returns selected index/indices
</ParamField>

<ParamField path="multiselect" type="bool | None" default="None">
  If True, multiple selections allowed
</ParamField>

<ParamField path="allow_custom_value" type="bool" default="False">
  If True, users can enter custom values
</ParamField>

<ParamField path="max_choices" type="int | None" default="None">
  Maximum number of selections (multiselect only)
</ParamField>

<ParamField path="filterable" type="bool" default="True">
  Whether users can type to filter options
</ParamField>

<ParamField path="label" type="str | None" default="None">
  Label displayed above component
</ParamField>

<ParamField path="interactive" type="bool | None" default="None">
  Whether selections can be made
</ParamField>

## Events

* **change** - Triggered when selection changes
* **input** - Triggered on input
* **select** - Triggered when option is selected
* **focus** - Triggered when component gains focus
* **blur** - Triggered when component loses focus
* **key\_up** - Triggered on key release

## Examples

### With labels and values

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

gr.Dropdown(
    choices=[
        ("Small (256x256)", "small"),
        ("Medium (512x512)", "medium"),
        ("Large (1024x1024)", "large")
    ],
    value="medium",
    label="Image size"
)
```

### Multiselect

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

gr.Dropdown(
    choices=["Python", "JavaScript", "Java", "C++"],
    multiselect=True,
    value=["Python"],
    label="Select languages"
)
```

### Custom values allowed

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

gr.Dropdown(
    choices=["Red", "Blue", "Green"],
    allow_custom_value=True,
    label="Choose or enter a color"
)
```


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