ShelfWidgetHeader

A widget's header row (DroppyKit 1.23.0): a 12pt medium symbol and a 12pt semibold title in secondary ink, the controls that act on the whole widget at its trailing end.

@MainActor struct ShelfWidgetHeader<Trailing> where Trailing : View

Alone on a notched Mac or the camera island, it wraps itself beside the camera whenever the host offers it: the title in the left band, dropping its words for its symbol before it reaches the camera, the controls in the right band at 28pt, nothing in between. Everywhere else it is the classic row, headerHeight tall. Declare header: .standard in init(single:split:splitMinimumWidth:pairWeight:header:) (the default is nil, no wrap) and draw this at the top: nothing else to keep in step. Its title is looked up in your droplet's own String Catalog first, then Droppy's.

ShelfWidgetHeader("World Clock", systemImage: "globe") {
    Button("Seconds", systemImage: "clock") { showsSeconds.toggle() }
        .labelStyle(.iconOnly)
}

Available from DroppyKit 1.23.0.

Initializers

init(_:systemImage:dso:)

@MainActor init(_ title: String, systemImage: String? = nil, dso: UnsafeRawPointer = #dsohandle)

A header with no controls.

init(_:systemImage:dso:trailing:)

@MainActor init(_ title: String, systemImage: String? = nil, dso: UnsafeRawPointer = #dsohandle, @ViewBuilder trailing: () -> Trailing)

Creates the row.

  • Parameters:
  • title: The widget's name, sentence case, looked up in your droplet's own String Catalog first, then Droppy's.
  • systemImage: Its SF Symbol, or nil.
  • dso: Filled in by the compiler; never pass it.
  • trailing: The controls that act on the whole widget. A plain Button is the wash at the header's size.

Properties

body

@MainActor var body: some View { get }