CustomTabs
is a SwiftUI component that provides a customizable tab navigation experience. It comes with an underline indicator to show the currently selected tab. This component is useful for scenarios where you want more control over the appearance and behavior of your tab navigation.
CustomTabs.swift
file in your SwiftUI project. File Link
selectedTab: Binding<String>
- A binding to the currently selected tab key.tabs: [(String, AnyView)]
- An array of tuples where the first element is the tab key and the second is the view to display when the tab is selected.underlineColor: Color
- Color for the underline that indicates the currently selected tab. Default is .white
(Note: This is not suitable for light mode).CustomTabs
component: