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

Greeting Header

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

A home greeting - avatar, 'Good morning' and a notification bell.

Navigation · SwiftUI · iOS 17

  • navigation
  • swiftui

The actual source

HeaderGreeting.swift
// Greeting Header · syxUI · https://syxui.dev/components/hdr-greeting
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

// Greeting header with avatar + notification
struct HeaderGreeting: View {
    var body: some View {
        HStack(spacing: 12) {
            Image("person_2").resizable().scaledToFill().frame(width: 46, height: 46).clipShape(Circle())
            VStack(alignment: .leading, spacing: 2) {
                Text("Good morning").font(.system(size: 13)).foregroundStyle(.secondary)
                Text("James Wilson").font(.system(size: 18, weight: .semibold))
            }
            Spacer()
            Image(systemName: "bell.badge").font(.system(size: 20)).foregroundStyle(.primary)
        }.frame(width: 340)
    }
}
iOS 17 · 1 dependencies

Dependencies

SwiftUI
  • person_2 (image asset)

Requires iOS 17