Skip to content
Glass Tab Bar preview
Rendered from the SwiftUI source on this page.

Glass Tab Bar

From syxUI — written for both platforms, not translated between them.

A frosted-glass bottom tab bar with icons and labels.

Navigation · SwiftUI · iOS 17

  • navigation
  • swiftui

The actual source

GlassTabBar.swift
// Glass Tab Bar · syxUI · https://syxui.dev/components/nav2-glass-tab
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

let navBlue = Color(red: 0.0, green: 0.47, blue: 1.0)

// Glass bottom tab bar
struct GlassTabBar: View {
    @State private var sel = 0
    let tabs = [("house.fill", "Home"), ("magnifyingglass", "Search"), ("heart.fill", "Saved"), ("person.fill", "Profile")]
    var body: some View {
        HStack {
            ForEach(Array(tabs.enumerated()), id: \.offset) { i, t in
                VStack(spacing: 4) { Image(systemName: t.0).font(.system(size: 20)); Text(t.1).font(.system(size: 10, weight: .medium)) }
                    .foregroundStyle(sel == i ? navBlue : Color.secondary).frame(maxWidth: .infinity).onTapGesture { sel = i }
            }
        }.padding(.vertical, 10).padding(.horizontal, 8).background(Color(.systemBackground), in: RoundedRectangle(cornerRadius: 24, style: .continuous)).overlay(RoundedRectangle(cornerRadius: 24, style: .continuous).stroke(Color.primary.opacity(0.10), lineWidth: 1)).shadow(color: .black.opacity(0.06), radius: 10, y: 4).frame(width: 360)
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17