Swiftpack.co - quanghits/SwiftUI-Tabs as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by quanghits.
quanghits/SwiftUI-Tabs 1.0.0
A beautiful Tabs view using SwiftUI
⭐️ 3
🕓 1 year ago
.package(url: "https://github.com/quanghits/SwiftUI-Tabs.git", from: "1.0.0")

SwiftUI Tabs

SlidingTabView is a simple Android-Like tab view that is built using the latest and greatest SwiftUI.

Usage

Just instantiate and bind it to your state.

@State var selectedTab: Int = 0

Simple

Tabs(tabs:  ["Music", "Movies", "Books", "Games"],
     selectedTab: $selectedTab,
     content: {
        Text("Music").font(.system(size: 15)).foregroundColor(.black).tag(0)
        Text("Movies").tag(1)
        Text("Books").tag(2)
        Text("Games").tag(3)
     })

Advanced

Tabs(tabs:  ["Music", "Movies", "Books", "Games"],
     selectedTab: $selectedTab,
     content: {
        Text("Music").font(.system(size: 15)).foregroundColor(.black).tag(0)
        Text("Movies").tag(1)
        Text("Books").tag(2)
        Text("Games").tag(3)
     },
     backgroundColor: .white,
     contentColor: .white,
     textColor: .black.opacity(0.4),
     activeTextColor: .black.opacity(0.8),
     barIndicatorColor: .blue.opacity(0.7),
     textSize: 16,
     padding: 15)

Suggestions or feedback?

Feel free to create a pull request!

Refer

https://github.com/QuynhNguyen/SlidingTabView

GitHub

link
Stars: 3
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Related Packages

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics