ShelfWidgetProviding

Adopt to contribute one or more widgets to the notch shelf.

@MainActor protocol ShelfWidgetProviding : Droplet

Every member is main-actor isolated, inherited from Droplet.

  • Note: Maturity: Stable. Covered by the 1.0 compatibility promise. Host support: the shipping Droppy does not mount external shelf widgets yet, so develop against DroppyKitHarness, which renders both the solo and grouped compositions. See Host support.

Properties

widgetDescriptors

@MainActor var widgetDescriptors: [ShelfWidgetDescriptor] { get }

The widgets this droplet provides. Read once at activation and again after every host state-change broadcast (statePublisher); keep it stable and cheap.

Methods

makeWidgetSettingsPopover(_:)

@MainActor func makeWidgetSettingsPopover(_ id: ShelfWidgetID) -> AnyView?

Optional inline settings popover shown from the widget's gear affordance. Return nil when the widget has no inline settings. Defaults to nil.

makeWidgetSettingsPopover(_:)

@MainActor func makeWidgetSettingsPopover(_ id: ShelfWidgetID) -> AnyView?

makeWidgetView(_:context:)

@MainActor func makeWidgetView(_ id: ShelfWidgetID, context: ShelfWidgetContext) -> AnyView

Builds the widget's live view. Views render on dark shelf surfaces; use light foreground colors and the DroppyKit design tokens.

Hosts MUST call this with .solo, isPaired == false, and the settled solo slot width for a one-widget row. For every grouped row of two to four widgets, hosts MUST set isPaired and isCompact to true, pass each widget's settled slot width, and assign .leading, .middle, or .trailing according to its real position. Providers MUST render both the solo and grouped contexts from these facts; they must not infer row count from a product-specific width table.