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

Feature Banner

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

A new-feature announcement banner.

Banners · SwiftUI · iOS 17

  • banners
  • swiftui

The actual source

FeatureBanner.swift
// Feature Banner · syxUI · https://syxui.dev/components/bt-feature
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

let btBlue = Color(red: 0.0, green: 0.47, blue: 1.0)
let btPurple = Color(red: 0.55, green: 0.40, blue: 0.90)

// New feature announcement
struct FeatureBanner: View {
    var body: some View {
        HStack(spacing: 12) {
            Image(systemName: "sparkles").font(.system(size: 18)).foregroundStyle(.white).frame(width: 38, height: 38).background(LinearGradient(colors: [btPurple, btBlue], startPoint: .topLeading, endPoint: .bottomTrailing), in: RoundedRectangle(cornerRadius: 10, style: .continuous))
            VStack(alignment: .leading, spacing: 2) { Text("New: AI Assistant").font(.system(size: 14, weight: .semibold)); Text("Get instant help, right in the app.").font(.system(size: 12)).foregroundStyle(.secondary) }
            Spacer()
            Image(systemName: "chevron.right").font(.system(size: 13, weight: .semibold)).foregroundStyle(.secondary)
        }.padding(14).frame(width: 340).background(btPurple.opacity(0.08), in: RoundedRectangle(cornerRadius: 16, style: .continuous)).overlay(RoundedRectangle(cornerRadius: 16, style: .continuous).stroke(btPurple.opacity(0.2), lineWidth: 1))
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17