Shrinking Tab Bar

Shrinking Tab Bar

A floating Liquid Glass tab bar that shrinks in place as you scroll down, getting shorter and narrower with labels folding away, while every tab stays tappable. It tracks the scroll continuously, grows back as you scroll up and springs to the nearest size when the scroll settles.

Luiz Mello
  • tab
  • navigation
  • animation

snippet.swift445 lines

8 files • Scroll to see all →
public struct ShrinkingTabBarTab: Identifiable, Hashable {    public let id: String    public let title: String    /// Outline symbol name; the selected tab uses its `.fill` variant automatically.    public let systemImage: String    public let badge: Int?​    public init(title: String, systemImage: String, badge: Int? = nil) {        self.id = title        self.title = title        self.systemImage = systemImage        self.badge = badge    }}
Viewing: Model.swift•1 of 8