Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SwiftUI MacOs Tabs

Tags:

swift

swiftui

I'm making a little helper app for myself in the MacOS, all using Swift + SwiftUI (newbie), but couldn't find a way to do these tabs:

MacOS Settings Tabs

Is there a specific way to create that interface with just SwiftUi, perhaps a library of sort? I did search for "SwiftUI tabs" but that only found the iOs tabs.

like image 788
norwegiandev Avatar asked Sep 02 '25 15:09

norwegiandev


1 Answers

You should use TabView for MacOs as well

TabView {
    Text("This is the first tab") //Replace this with the view content for the first tab
        .tabItem {
            Text("Sound Effects")
        }

    Text("This is the second tab") //same here
        .tabItem {
            Text("Output")
        }

    Text("This is the third tab") //and here 
        .tabItem {
            Text("Input")
        }
}
like image 116
Joakim Danielson Avatar answered Sep 05 '25 16:09

Joakim Danielson