Struggling with buttons colors

What about setting the first button as a primary button, and leave the rest as secondary. This can be done with the keyword argument type in st.button.

import streamlit as st
from itertools import cycle

cols = cycle(st.columns(3))

for i,col in zip(range(1, 13), cols):
    if i == 1: button_type = 'primary'        #Treat the button 1 as primary 
    else: button_type = 'secondary'        #Leave the rest as secondary
    with col: 
        st.button(f"Button #{i}", use_container_width=True, type=button_type)
2 Likes