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

Search Tip

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

Search with a save-search tip.

Inputs · SwiftUI · iOS 17

  • inputs
  • swiftui

The actual source

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

import SwiftUI

// Tip banner + search
struct SearchTip: View {
    var body: some View {
        VStack(spacing: 12) {
            HStack(spacing: 8) { Image(systemName: "magnifyingglass").font(.system(size: 15)).foregroundStyle(.secondary); Text("Search for anything").font(.system(size: 16)).foregroundStyle(.secondary); Spacer(); Image(systemName: "xmark").font(.system(size: 13, weight: .semibold)).foregroundStyle(.secondary) }.padding(.horizontal, 12).padding(.vertical, 11).background(Color.primary.opacity(0.06), in: RoundedRectangle(cornerRadius: 12, style: .continuous))
            HStack(spacing: 12) { Image(systemName: "star").font(.system(size: 18)).foregroundStyle(.secondary); VStack(alignment: .leading, spacing: 2) { Text("Save time - save your search").font(.system(size: 14, weight: .semibold)); Text("Tap the star to save and get alerts.").font(.system(size: 12)).foregroundStyle(.secondary) }; Spacer() }.padding(12).background(Color.primary.opacity(0.04), in: RoundedRectangle(cornerRadius: 12, style: .continuous))
        }.frame(width: 330)
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17