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](/images/api/column_config.column.jpg)
Column
Configure a generic column.
Column("Streamlit Widgets", width="medium", help="Streamlit **widget** commands 🎈")
![screenshot](/images/api/column_config.textcolumn.jpg)
Text column
Configure a text column.
TextColumn("Widgets", max_chars=50, validate="^st\.[a-z_]+$")
![screenshot](/images/api/column_config.numbercolumn.jpg)
Number column
Configure a number column.
NumberColumn("Price (in USD)", min_value=0, format="$%d")
![screenshot](/images/api/column_config.checkboxcolumn.jpg)
Checkbox column
Configure a checkbox column.
CheckboxColumn("Your favorite?", help="Select your **favorite** widgets")
![screenshot](/images/api/column_config.selectboxcolumn.jpg)
Selectbox column
Configure a selectbox column.
SelectboxColumn("App Category", options=["🤖 LLM", "📈 Data Viz"])
![screenshot](/images/api/column_config.datetimecolumn.jpg)
Datetime column
Configure a datetime column.
DatetimeColumn("Appointment", min_value=datetime(2023, 6, 1), format="D MMM YYYY, h:mm a")
![screenshot](/images/api/column_config.datecolumn.jpg)
Date column
Configure a date column.
DateColumn("Birthday", max_value=date(2005, 1, 1), format="DD.MM.YYYY")
![screenshot](/images/api/column_config.timecolumn.jpg)
Time column
Configure a time column.
TimeColumn("Appointment", min_value=time(8, 0, 0), format="hh:mm a")
![screenshot](/images/api/column_config.listcolumn.jpg)
List column
Configure a list column.
ListColumn("Sales (last 6 months)", width="medium")
![screenshot](/images/api/column_config.linkcolumn.jpg)
Link column
Configure a link column.
LinkColumn("Trending apps", max_chars=100, validate="^https://.*$")
![screenshot](/images/api/column_config.imagecolumn.jpg)
Image column
Configure an image column.
ImageColumn("Preview Image", help="The preview screenshots")
![screenshot](/images/api/column_config.linechartcolumn.jpg)
Line chart column
Configure a line chart column.
LineChartColumn("Sales (last 6 months)" y_min=0, y_max=100)
![screenshot](/images/api/column_config.barchartcolumn.jpg)
Bar chart column
Configure a bar chart column.
BarChartColumn("Marketing spend" y_min=0, y_max=100)
![screenshot](/images/api/column_config.progresscolumn.jpg)
Progress column
Configure a progress column.
ProgressColumn("Sales volume", min_value=0, max_value=1000, format="$%f")
Still have questions?
Our forums are full of helpful information and Streamlit experts.