choosing-streamlit-selection-widgets

Map Streamlit selection inputs to widget recommendations for UI design tasks.

Updated Jan 27, 2026
One-click install
npx skills add https://github.com/erickfmm/transformer-encoder-frankestein --skill choosing-streamlit-selection-widgets-erickfmm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: choosing-streamlit-selection-widgets
Source: https://github.com/erickfmm/transformer-encoder-frankestein/tree/main/.agents/skills/developing-with-streamlit/skills/choosing-streamlit-selection-widgets
Command: npx skills add https://github.com/erickfmm/transformer-encoder-frankestein --skill choosing-streamlit-selection-widgets-erickfmm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Choosing the right Streamlit selection widget is essential for clean UIs and optimal user experience, especially when the number of options and the desired interaction type vary.

Core Features & Use Cases

  • Guides whether to use st.segmented_control, st.pills, st.selectbox, or st.radio based on the option count and whether single or multi-select is required.
  • Provides practical examples and decision rules for common UI patterns in Streamlit apps.
  • Use Case: select a small set of categories with all options visible, or present a long list of countries in a searchable dropdown.

Quick Start

Describe your UI goal and I will recommend the ideal Streamlit selection widget.

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 between st.selectbox and st.radio in Streamlit?

Choosing between Streamlit selection widgets depends on option count and selection type. st.radio is ideal for single-select with few options, while st.selectbox handles long, searchable lists better.

When should I use st.segmented_control or st.pills in Streamlit?

Use st.segmented_control or st.pills in Streamlit when you need a compact UI for a small set of categories with all options visible. They are optimal for single or multi-select interactions with limited choices.

What is the best way to handle multi-select options in a Streamlit UI?

The best way to handle multi-select in Streamlit is by using widgets like st.pills for a small number of visible categories or st.selectbox for longer lists, based on the option count and UI space.

Can I use Streamlit selection widgets for both single and multi-select scenarios?

Yes, Streamlit selection widgets support both single and multi-select scenarios. The optimal widget is determined by a deterministic mapping from your input patterns, like option count, to the appropriate UI component.

How do I decide which Streamlit widget to use for a long list of options?

To decide which Streamlit widget to use for a long list of options, apply a dropdown widget like st.selectbox. It provides a searchable interface, making it superior for handling many options efficiently.