DropletHUDArt
A HUD card's leading art when an SF Symbol is not enough: a photo, an avatar, an app's own icon, with an optional badge (1.25.0).
struct DropletHUDArt
Droppy lays it out in the art slot of its own island pill: it proposes the slot's square, clips the view to the slot's concentric shape and puts the badge on the slot's lower trailing corner at the badge size, so the droplet draws the picture and nothing else. Fill the size you are offered; never pad, frame, round or shadow it yourself.
Available from DroppyKit 1.25.0. It is optional API: a droplet that keeps an older kit.minAPI imports DroppyKit with @_weakLinked and checks #_hasSymbol(DropletHUDArt.self) before using it or the card initializer that takes it, with its 1.23.0 card or its own HUD as the fallback.
Initializers
init(content:)
init(@ViewBuilder content: @escaping @MainActor @Sendable () -> some View)
Art without a badge.
init(content:badge:)
init(@ViewBuilder content: @escaping @MainActor @Sendable () -> some View, @ViewBuilder badge: @escaping @MainActor @Sendable () -> some View)
Art with a badge, an app's icon or a small symbol.
Properties
makeBadge
let makeBadge: (@MainActor @Sendable () -> AnyView)?
Builds the badge, or nil for none.
makeContent
let makeContent: @MainActor @Sendable () -> AnyView
Builds the picture. Rebuilt on every render pass.