
Searchable Menu
From syxUI — written for both platforms, not translated between them.
A menu with a search field.
Navigation · SwiftUI · iOS 17
- navigation
- swiftui
The actual source
MenuSearch.swift
// Searchable Menu · syxUI · https://syxui.dev/components/menu-search
// Free in any project. Keep this line and credit syxUI where a person can read it.
import SwiftUI
func menuCard<C: View>(_ w: CGFloat, @ViewBuilder _ c: () -> C) -> some View {
c().frame(width: w).background(Color(.systemBackground), in: RoundedRectangle(cornerRadius: 14, style: .continuous)).overlay(RoundedRectangle(cornerRadius: 14, style: .continuous).stroke(Color.primary.opacity(0.07), lineWidth: 1)).shadow(color: .black.opacity(0.06), radius: 14, y: 5)
}
struct MenuSearch: View { var body: some View { menuCard(260) { VStack(spacing: 0) { HStack(spacing: 8) { Image(systemName: "magnifyingglass").font(.system(size: 13)).foregroundStyle(.secondary); Text("Search…").font(.system(size: 14)).foregroundStyle(.secondary); Spacer() }.padding(.horizontal, 12).padding(.vertical, 10).background(Color.primary.opacity(0.05)); Divider(); ForEach(["Design", "Development", "Marketing"], id: \.self) { o in HStack { Text(o).font(.system(size: 15)); Spacer() }.padding(.horizontal, 14).padding(.vertical, 11); Divider() } } } } }
iOS 17 · No dependencies
Dependencies
- SwiftUI
- No external dependencies
Requires iOS 17


