Column configuration

When working with data in Streamlit, the st.column_config class is a powerful tool for configuring data display and interaction. Specifically designed for the column_config parameter in st.dataframe and st.data_editor, it provides a suite of methods to tailor your columns to various data types - from simple text and numbers to lists, URLs, images, and more.

Whether it's translating temporal data into user-friendly formats or utilizing charts and progress bars for clearer data visualization, column configuration not only provides the user with an enriched data viewing experience but also ensures that you're equipped with the tools to present and interact with your data, just the way you want it.

screenshot

Column

Configure a generic column.

Python
Column("Streamlit Widgets", width="medium", help="Streamlit **widget** commands 🎈")
screenshot

Text column

Configure a text column.

Python
TextColumn("Widgets", max_chars=50, validate="^st\.[a-z_]+$")
screenshot

Number column

Configure a number column.

Python
NumberColumn("Price (in USD)", min_value=0, format="$%d")
screenshot

Checkbox column

Configure a checkbox column.

Python
CheckboxColumn("Your favorite?", help="Select your **favorite** widgets")
screenshot

Selectbox column

Configure a selectbox column.

Python
SelectboxColumn("App Category", options=["🤖 LLM", "📈 Data Viz"])
screenshot

Multiselect column

Configure a multiselect column.

Python
MultiselectColumn("App Category", options=["LLM", "Visualization"])
screenshot

Datetime column

Configure a datetime column.

Python
DatetimeColumn("Appointment", min_value=datetime(2023, 6, 1), format="D MMM YYYY, h:mm a")
screenshot

Date column

Configure a date column.

Python
DateColumn("Birthday", max_value=date(2005, 1, 1), format="DD.MM.YYYY")
screenshot

Time column

Configure a time column.

Python
TimeColumn("Appointment", min_value=time(8, 0, 0), format="hh:mm a")
screenshot

JSON column

Configure a JSON column.

Python
JSONColumn("Properties", width="medium")
screenshot

List column

Configure a list column.

Python
ListColumn("Sales (last 6 months)", width="medium")
screenshot

Link column

Configure a link column.

Python
LinkColumn("Trending apps", max_chars=100, validate="^https://.*$")
screenshot

Image column

Configure an image column.

Python
ImageColumn("Preview Image", help="The preview screenshots")
screenshot

Area chart column

Configure an area chart column.

Python
AreaChartColumn("Sales (last 6 months)" y_min=0, y_max=100)
screenshot

Line chart column

Configure a line chart column.

Python
LineChartColumn("Sales (last 6 months)" y_min=0, y_max=100)
screenshot

Bar chart column

Configure a bar chart column.

Python
BarChartColumn("Marketing spend" y_min=0, y_max=100)
screenshot

Progress column

Configure a progress column.

Python
ProgressColumn("Sales volume", min_value=0, max_value=1000, format="$%f")
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.