DropletOptionsButton

The "..." button every droplet's options live behind (DroppyKit 1.30.0): a round button that morphs into Droppy's Liquid menu, the one every option button and dropdown in Droppy opens.

@MainActor struct DropletOptionsButton

It draws the right disc for where it is, so a droplet never picks: on the shelf (inside a widget's mount) the flat wash disc at the mount's control size, 28pt in the header and 34 or 28pt in the body; anywhere else (a droplet's panel, an expanded surface's toolbar, a popover) the native circular Liquid Glass button at Droppy's one control height, 36pt.

DropletOptionsButton("Clock options") {
    [
        DropletLiquidMenuItem(title: "Show seconds", systemImage: "clock.fill", isSelected: showsSeconds) {
            showsSeconds.toggle()
        },
        DropletLiquidMenuItem(title: "Remove clock", systemImage: "trash.fill", isDestructive: true) {
            remove()
        },
    ]
}

Inside Droppy the menu is Droppy's own (keyboard, VoiceOver, submenus, the chosen row's trailing checkmark, opening away from the notch or the island on the shelf); in the harness and previews it is SwiftUI's Menu. The items are built when the button is pressed. Its title is what VoiceOver says and the tooltip shows, looked up in your droplet's own String Catalog first, then Droppy's.

Available from DroppyKit 1.30.0; it needs a Droppy that embeds 1.30.0.

Initializers

init(_:systemImage:attachment:dso:items:)

@MainActor init(_ title: String = "", systemImage: String = "ellipsis", attachment: DropletLiquidMenuAttachment = .automatic, dso: UnsafeRawPointer = #dsohandle, items: @escaping @MainActor () -> [DropletLiquidMenuItem])

Creates the button.

  • Parameters:
  • title: What the button does, sentence case ("Clock options"); empty says "More".
  • systemImage: The glyph; ellipsis unless the options are better said by another symbol.
  • attachment: The corner the menu grows from; .automatic lets Droppy decide (away from the notch or the island on the shelf).
  • dso: Filled in by the compiler; never pass it.
  • items: The rows, built when the button is pressed.

Properties

body

@MainActor var body: some View { get }