:wave: Hi <@U02AB5P2XU6> with new version of kobwe...
# kobweb
j
đź‘‹ Hi @David Herman with new version of kobweb I have started using tabs. Works great, but would be possible to add possibility to set initially selected tab?
d
You can! Each tab lets you configure if it's the default one as a parameter.
The rule for tabs is that the initial tab is the first one that is tagged "isEnabled == true && isDefault == true", and if there are no defaults, then the first tab that is enabled will be selected first.
Here's some sample code of how that looks:
Copy code
Tabs {
    TabPanel {
        Tab { Text("Tab 1") }
        Panel { Text("Panel 1") }
    }
    TabPanel {
        Tab(isDefault = true) { Text("Tab 2") }
        Panel { Text("Panel 2") }
    }
}
j
Hi @David Herman thanks for your response. Great - I did not know that I could use it this way 👍 I’ll try.
d
Sounds good. I hope it works out for you and I'm curious what you'll come up with! Also, I'll be working on more widgets over the next months so let me know if you feel like anything in particular is missing