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

Popular

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

A popular-searches list.

Inputs · SwiftUI · iOS 17

  • inputs
  • swiftui

The actual source

SearchPopular.swift
// Popular · syxUI · https://syxui.dev/components/search-popular
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

// Popular list with chevrons
struct SearchPopular: View {
    var body: some View {
        VStack(alignment: .leading, spacing: 0) {
            Text("POPULAR").font(.system(size: 12, weight: .semibold)).foregroundStyle(.secondary).tracking(0.6).padding(.bottom, 4)
            ForEach(["corset top", "vintage denim", "brandy melville"], id: \.self) { s in
                HStack { Text(s).font(.system(size: 15)); Spacer(); Image(systemName: "chevron.right").font(.system(size: 12, weight: .semibold)).foregroundStyle(.secondary.opacity(0.5)) }.padding(.vertical, 12)
                Divider()
            }
        }.frame(width: 300)
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17