Skip to content
Recent Chips preview
Rendered from the SwiftUI source on this page.

Recent Chips

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

Recent searches as removable chips.

Inputs · SwiftUI · iOS 17

  • inputs
  • swiftui

The actual source

SearchRecentChips.swift
// Recent Chips · syxUI · https://syxui.dev/components/search-recent-chips
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

// Recent searches as chips
struct SearchRecentChips: View {
    var body: some View {
        VStack(alignment: .leading, spacing: 10) {
            Text("Recent").font(.system(size: 13, weight: .semibold)).foregroundStyle(.secondary)
            HStack(spacing: 8) { ForEach(["vintage", "corset top", "y2k"], id: \.self) { t in HStack(spacing: 5) { Text(t).font(.system(size: 13, weight: .medium)); Image(systemName: "xmark").font(.system(size: 9, weight: .bold)) }.foregroundStyle(.primary).padding(.horizontal, 10).padding(.vertical, 6).background(Color.primary.opacity(0.06), in: Capsule()) } }
        }.frame(width: 320)
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17