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.

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

Text column

Configure a text column.

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

Number column

Configure a number column.

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

Checkbox column

Configure a checkbox column.

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

Selectbox column

Configure a selectbox column.

SelectboxColumn("App Category", options=["πŸ€– LLM", "πŸ“ˆ Data Viz"])
screenshot

Datetime column

Configure a datetime column.

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

Date column

Configure a date column.

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

Time column

Configure a time column.

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

List column

Configure a list column.

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

Link column

Configure a link column.

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

Image column

Configure an image column.

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

Area chart column

Configure an area chart column.

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

Line chart column

Configure a line chart column.

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

Bar chart column

Configure a bar chart column.

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

Progress column

Configure a progress column.

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.