Drop-Down with Gradio

Learn how to create drop-downs in Gradio and introduce more interactivity to applications!

The Dropdown component

Dropdown allows the user to make a selection from a list of possible options, much like a CheckboxGroup. Generally, they can achieve similar things, with just some minor differences, including:

  • Dropdown will present the options once selected as a list that pops out, rather than a CheckboxGroup where you see all the options at once.

  • Dropdown can allow users to add their own value to the available options (if allow_custom_value is set as True).

At the end of the day, it is usually just a visual preference that differentiates whether to use a Dropdown or a CheckboxGroup.

A Dropdown in Gradio can be instantiated with gr.Dropdown() or with Interface string shortcut 'dropdown'.

Get hands-on with 1300+ tech skills courses.