Hi all,
For those who want a glimpse of what’s possible with customizing the Softr tab container=>
https://matt7933.softr.app/native-tabs
How to do this?
All css codes to be inserted in the header of the page settings.
Tab Design 1
<style>
#tab-container5 [role="tablist"] {
border-bottom: 0px solid #FFFFFF !important;
}
#tab-container5 button:not([title="Prev"]):not([title="Next"]) {
background-color: #ffffff !important;
color: #000000 !important;
border: none;
padding: 10px 20px;
cursor: pointer;
font-size: 16px;
font-family: Arial, sans-serif;
outline: none;
transition: background-color 0.3s;
border-radius: 15px 15px 0 0 / 15px 15px 15px 15px;
}
#tab-container5 button:hover:not([title="Prev"]):not([title="Next"]),
#tab-container5 button:active:not([title="Prev"]):not([title="Next"]),
#tab-container5 button[data-state="active"]:not([title="Prev"]):not([title="Next"]),
#tab-container5 button[data-state="active"]:hover:not([title="Prev"]):not([title="Next"]) {
background-color: #F2F2F2 !important;
border: none !important;
border-radius: 15px 15px 0 0 / 15px 15px 15px 15px;
}
</style>
Tab Design 2 (same as design 1 but squared borders)
<style>
#tab-container4 [role="tablist"] {
border-bottom: 0px solid #FFFFFF !important;
}
#tab-container4 button:not([title="Prev"]):not([title="Next"]) {
background-color: #ffffff !important;
color: #000000 !important;
border: none;
padding: 10px 20px;
cursor: pointer;
font-size: 16px;
font-family: Arial, sans-serif;
outline: none;
transition: background-color 0.3s;
}
#tab-container4 button:hover:not([title="Prev"]):not([title="Next"]),
#tab-container4 button:active:not([title="Prev"]):not([title="Next"]),
#tab-container4 button[data-state="active"]:not([title="Prev"]):not([title="Next"]),
#tab-container4 button[data-state="active"]:hover:not([title="Prev"]):not([title="Next"]) {
background-color: #F4F2EE !important;
border: none !important;
}
</style>
Tab Design 3
<style>
#tab-container3 button {
transition: font-size ease 0.2s !important;
}
#tab-container3 button:hover {
font-size: 16px !important;
}
#tab-container3 button[data-state="active"] {
font-size: 16px !important;
}
</style>
Tab Design 4
<style>
#tab-container2 [role="tablist"] {
display: flex !important;
justify-content: center !important;
}
</style>
Tab Design 5
#tab-container1 [data-testid="tab-button"]:hover,
#tab-container1 [data-testid="tab-button"][data-state="active"] {
border-bottom: 2px solid #3278FF !important;
color: #3278FF !important;
}
Note that if you have a lot of tabs or if you are on mobile, you will need to use the :not
pseudo-class so that the left and right arrows (Prev/Next) appear for tab navigation.
By using the :not
pseudo class I exclude these two arrows from the css rules I wrote.
You can see it in the codes of Tab Design 1 and Tab Design 2 (the use of :not
is specific to these two tab containers as the written css rules apply to the whole button… While the left and right arrows are also inside a button element)