choosing-streamlit-selection-widgets

Guide selection of Streamlit widgets for single or multi-select UI scenarios.

224|23|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/streamlit/agent-skills --skill choosing-streamlit-selection-widgets-streamlit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: choosing-streamlit-selection-widgets
Source: https://github.com/streamlit/agent-skills/tree/main/developing-with-streamlit/skills/choosing-streamlit-selection-widgets
Command: npx skills add https://github.com/streamlit/agent-skills --skill choosing-streamlit-selection-widgets-streamlit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Choosing the right Streamlit selection widget for a UI, helping decide among radio buttons, selectbox, segmented control, pills, or other option selectors based on the number of options and required interaction.

Core Features & Use Cases

  • Guidance on when to use specific widgets:
    • st.segmented_control for 2-5 options, single select, all visible
    • st.pills for 2-5 options, multi-select, all visible
    • st.selectbox for many options, single select, dropdown
    • st.multiselect for many options, multi-select, dropdown
  • Practical examples and best practices for making UI intuitive and accessible.

Quick Start

Instruct AI to recommend the best widget for a given set of options and interaction requirements in a Streamlit app.

Frequently Asked Questions about choosing-streamlit-selection-widgets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose the right Streamlit selection widget for my UI?

To choose the right Streamlit selection widget, evaluate the number of options and whether single or multi-select is needed. Use st.segmented_control or st.pills for 2-5 visible options, and st.selectbox or st.multiselect for larger dropdown lists.

When should I use st.segmented_control instead of st.selectbox in Streamlit?

Use st.segmented_control in Streamlit for single-select scenarios with 2-5 options where all choices should remain visible. Use st.selectbox when dealing with many options that require a dropdown interface to save space.

What is the best way to implement multi-select with few options in Streamlit?

The best way to implement multi-select with few options in Streamlit is using st.pills. It keeps 2-5 options fully visible on the interface, allowing users to select multiple items without opening a dropdown menu.

Can I use Streamlit selection widgets for large option sets?

Yes, you can use Streamlit selection widgets for large option sets by using st.selectbox for single-select or st.multiselect for multiple selections. Both widgets utilize a dropdown behavior to handle many options efficiently.

Does Streamlit support a multi-select alternative to segmented control?

Yes, Streamlit supports st.pills as the multi-select alternative to st.segmented_control. Both are designed for 2-5 options with all items visible, but st.pills allows selecting multiple options while st.segmented_control restricts to single selection.

Why does my Streamlit UI feel cluttered with multiple radio buttons?

Your Streamlit UI might feel cluttered if using radio buttons for many options. For 2-5 single-select options, switch to st.segmented_control, or use st.selectbox for larger sets to collapse options into a clean dropdown.