📘 Introduction

Streamlit makes it easy to build interactive apps — and its st.data_editor() widget lets users edit data directly inside your app. But what if a single cell needs multiple selections, like tags, skills, or categories? 🤔

That’s where st.column_config.MultiselectColumn comes in! It allows you to add multi-select dropdowns inside your editable tables — simple, intuitive, and perfect for dynamic data editing. In this guide, you’ll learn how to use it step by step. 🚀

💡 Why Use a Multiselect Column?

You might need users to:

✅ Assign multiple labels or tags
✅ Choose several skills or technologies
✅ Select multiple categories per item

💡
Without MultiselectColumn, you’d need multiple columns or extra widgets — now it’s all built in. 🙌

✅ Prerequisites

Before starting, make sure you have the following:

🐍☑️ Python installed
📦☑️ Pip installed
🌐☑️ A virtual environment (venv) created and activated

📦1️⃣ Install Libraries

Install the following Python packages using pip:

pip install streamlit pandas

📥2️⃣ Import Libraries

Start by importing the required Python modules:

import streamlit as st
import pandas as pd

✍️3️⃣ Create a Basic Editable Table

Let’s start simple — create an editable DataFrame.

st.title("🎯 Multiselect Column in Streamlit")
st.write("This app demonstrates how to use `st.column_config.MultiselectColumn` to create interactive multi-select fields inside tables.")

# Sample data
data = pd.DataFrame({
    "Name": ["Alice", "Bob", "Charlie"],
    "Skills": [["Python"], ["JavaScript", "HTML"], []],
})

# Basic data editor
edited_data = st.data_editor(data)
st.write("Edited Data:")
st.write(edited_data)

Run the app:

streamlit run app.py
You’ll see a simple editor — but the “Skills” column isn’t interactive yet. Let’s fix that. ⚙️

⚡4️⃣ Add a Multiselect Column

Now configure the column using st.column_config.MultiselectColumn:

You can view this post with the tier: Academy Membership

Join academy now to read the post and get access to the full library of premium posts for academy members only.

Join Academy Already have an account? Sign In