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

Search Results

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

A results list with thumbnails.

Inputs · SwiftUI · iOS 17

  • inputs
  • swiftui

The actual source

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

import SwiftUI

// Results list with thumbnails
struct SearchResults: View {
    let imgs = ["photo_travel", "photo_food", "photo_pet"]
    let titles = [("The Hate U Give", "Drama Movie"), ("Teen Wolf", "Drama Series"), ("Spy x Family", "Action Series")]
    var body: some View {
        VStack(spacing: 12) {
            ForEach(Array(imgs.enumerated()), id: \.offset) { i, im in
                HStack(spacing: 12) { Image(im).resizable().scaledToFill().frame(width: 54, height: 54).clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous)); VStack(alignment: .leading, spacing: 3) { Text(titles[i].0).font(.system(size: 15, weight: .semibold)); Text(titles[i].1).font(.system(size: 13)).foregroundStyle(.secondary) }; Spacer() }
            }
        }.frame(width: 320)
    }
}
iOS 17 · 3 dependencies

Dependencies

SwiftUI
  • photo_travel (image asset)
  • photo_food (image asset)
  • photo_pet (image asset)

Requires iOS 17