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

Trending

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

A ranked trending-searches list.

Inputs · SwiftUI · iOS 17

  • inputs
  • swiftui

The actual source

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

import SwiftUI

let seBlue = Color(red: 0.0, green: 0.47, blue: 1.0)

// Trending searches
struct SearchTrending: View {
    var body: some View {
        VStack(alignment: .leading, spacing: 0) {
            HStack(spacing: 6) { Image(systemName: "flame.fill").font(.system(size: 13)).foregroundStyle(Color(red: 0.98, green: 0.55, blue: 0.10)); Text("Trending").font(.system(size: 13, weight: .semibold)).foregroundStyle(.secondary) }.padding(.bottom, 6)
            ForEach(Array(["AirPods Pro", "iPhone 17", "MacBook Air"].enumerated()), id: \.offset) { i, s in
                HStack(spacing: 12) { Text("\(i + 1)").font(.system(size: 15, weight: .bold)).foregroundStyle(seBlue).frame(width: 18); Text(s).font(.system(size: 15)); Spacer(); Image(systemName: "arrow.up.right").font(.system(size: 12)).foregroundStyle(Color(red: 0.16, green: 0.66, blue: 0.40)) }.padding(.vertical, 10)
            }
        }.frame(width: 300)
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17