Skip to content
Search Header preview
Rendered from the SwiftUI source on this page.

Search Header

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

A large title paired with a rounded search field.

Navigation · SwiftUI · iOS 17

  • navigation
  • swiftui

The actual source

HeaderSearch.swift
// Search Header · syxUI · https://syxui.dev/components/hdr-search
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

// Large title with a search field
struct HeaderSearch: View {
    var body: some View {
        VStack(alignment: .leading, spacing: 12) {
            Text("Explore").font(.system(size: 32, weight: .bold))
            HStack(spacing: 8) {
                Image(systemName: "magnifyingglass").font(.system(size: 16)).foregroundStyle(.secondary)
                Text("Search").font(.system(size: 16)).foregroundStyle(.secondary)
                Spacer()
                Image(systemName: "mic.fill").font(.system(size: 15)).foregroundStyle(.secondary)
            }
            .padding(.horizontal, 12).padding(.vertical, 10)
            .background(Color.primary.opacity(0.06), in: RoundedRectangle(cornerRadius: 12, style: .continuous))
        }.frame(width: 350)
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17