All Projects → onl1ner → TabBar

onl1ner / TabBar

Licence: MIT license
📱 TabBar – highly customizable tab bar for your SwiftUI application.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to TabBar

Readablebottombar
Yet another material bottom bar library for Android
Stars: ✭ 977 (+830.48%)
Mutual labels:  view, bar, tab
Android Slidr
Another android slider / seekbar, but different :-)
Stars: ✭ 326 (+210.48%)
Mutual labels:  view, bar
SwiftUIViewRecorder
Efficiently record any SwiftUI View as image or video
Stars: ✭ 20 (-80.95%)
Mutual labels:  view, swiftui
Tap water
【声明:未发布前,勿使用,勿star,预计2020年11月底发布】Flutter tab_bar组件,支持中间带加号按钮的TabBar,支持Lottie动画。iTeaTime(技术清谈)团队出品。Highly customizable tabBar and tabBarController for Flutter
Stars: ✭ 52 (-50.48%)
Mutual labels:  view, tabbar
react-native-smartbar
Maybe this is the best tabbar , support android and ios !
Stars: ✭ 29 (-72.38%)
Mutual labels:  tabbar, bar
Poliopager
A flexible TabBarController with search tab like SNKRS.
Stars: ✭ 133 (+26.67%)
Mutual labels:  tabbar, tab
Cyltabbarcontroller
[EN]It is an iOS UI module library for adding animation to iOS tabbar items and icons with Lottie, and adding a bigger center UITabBar Item. [CN]【中国特色 TabBar】一行代码实现 Lottie 动画TabBar,支持中间带+号的TabBar样式,自带红点角标,支持动态刷新。【iOS13 & Dark Mode & iPhone XS MAX supported】
Stars: ✭ 6,605 (+6190.48%)
Mutual labels:  view, tabbar
Navigationtabstrip
Navigation tab strip with smooth interaction.
Stars: ✭ 2,234 (+2027.62%)
Mutual labels:  bar, tab
MultiModal
Use multiple .sheet, .alert, etc. modifiers in the same SwiftUI View
Stars: ✭ 49 (-53.33%)
Mutual labels:  view, swiftui
react-native-scrollable-tabview
Based on pure JS scripts, without relying on native, no need for react-native link, Title / Header / Tabs / Sticky / Screen components can be flexibly configured, among which Tabs / Sticky can slide When it reaches the top, it will be topped.
Stars: ✭ 136 (+29.52%)
Mutual labels:  tabbar, tabview
react-native-tabbar
A tabbar component for React Native
Stars: ✭ 59 (-43.81%)
Mutual labels:  tabbar, tab
react-native-viewpager-indicator
修改自react-native-scrollable-tab-view,增加了根据文字内容适配下划线长度的功能。
Stars: ✭ 52 (-50.48%)
Mutual labels:  tabbar, tab
react-native-bubble-tabbar
🧼 Bubble Tab Bar Component for React Native which supports React Navigation V5 and TypeScript
Stars: ✭ 43 (-59.05%)
Mutual labels:  tabbar, tab-bar
KRTabBar
a beautiful easy to use UITabBarController
Stars: ✭ 24 (-77.14%)
Mutual labels:  uitabbar, uitabbarcontroller
buttons tabbar
A Flutter package that implements a TabBar where each label is a toggle button.
Stars: ✭ 49 (-53.33%)
Mutual labels:  tabbar, tab
Observable
A generic ObservableObject for every property!
Stars: ✭ 41 (-60.95%)
Mutual labels:  view, swiftui
Navigationtabbar
Navigation tab bar with colorful interactions.
Stars: ✭ 4,907 (+4573.33%)
Mutual labels:  bar, tab
Material Bottom Nav
A bottom navigation bar adhering to the Material Design specification.
Stars: ✭ 41 (-60.95%)
Mutual labels:  bar, tab
Tabbar
🔥空祖家的导航栏工具
Stars: ✭ 100 (-4.76%)
Mutual labels:  view, tabbar
react-native-tab-bars
Fully customizable navigation tab bar for React Native
Stars: ✭ 16 (-84.76%)
Mutual labels:  tab, tab-bar

TabBar

SwiftUI standard TabView component is not so flexible and to customize it you have to modify appearance proxy of UITabBar or implement your own one from scratch. The goal of this library is to solve this problem.

Table of contents

Requirements

  • SwiftUI
  • iOS 13.0 or above

Installation

TabBar is available through Swift Package Manager

Swift Package Manager

  • In Xcode select:

    File > Swift Packages > Add Package Dependency...
    
  • Then paste this URL:

    https://github.com/onl1ner/TabBar.git
    

Usage

To start using TabBar you have to create an enum which will implement Tabbable protocol:

enum Item: Int, Tabbable {
    case first = 0
    case second
    case third
    
    var icon: String {
        switch self {
            case .first:  // Name of icon of first item.
            case .second: // Name of icon of second item.
            case .third:  // Name of icon of third item.
        }
    }
    
    var title: String {
        switch self {
            case .first:  // Title of first item.
            case .second: // Title of second item.
            case .third:  // Title of third item.
        }
    }
}

After that you will be able to create TabBar instance:

struct ContentView: View {
    @State private var selection: Item = .first
    @State private var visibility: TabBarVisibility = .visible

    var body: some View {
        TabBar(selection: $selection, visibility: $visibility) {
            Text("First")
                .tabItem(for: Item.first)
            
            Text("Second")
                .tabItem(for: Item.second)
            
            Text("Third")
                .tabItem(for: Item.third)
        }
        .tabBar(style: CustomTabBarStyle())
        .tabItem(style: CustomTabItemStyle())
    }
}

After these actions tab bar with default style will be created.

Customization

TabBar component is highly customizable. This is achieved by introducing TabBarStyle and TabItemStyle protocols. By implementing each of the protocol you will be able to build your custom tab bar. NOTE that TabBar automaticaly pushes down to bottom any of tab bar styles.

After creating your custom styles you may inject them to your tab bar by using tabBar(style:) and tabItem(style:) functions. Here is the showcase of default style and one of the examples of what you can achieve by customizing tab bar:

Contribution

If you struggle with something feel free to open an issue. Pull requests are also appreciated.

License

TabBar is under the terms and conditions of the MIT license.

MIT License

Copyright (c) 2021 Tamerlan Satualdypov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].