IconButtonWithPopover

fun IconButtonWithPopover(iconPainter: Painter, isPopoverVisible: Boolean, popoverAlignment: PopoverAlignment, onClick: () -> Unit, modifier: Modifier = Modifier, popoverMinWidth: Dp = Dp.Unspecified, popoverMaxWidth: Dp = Dp.Unspecified, popoverPopupProperties: PopupProperties = popoverDefaultProperties, buttonType: ButtonType = ButtonType.Primary, buttonSize: ButtonSize = ButtonSize.LargeProductive, isEnabled: Boolean = true, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, onDismissRequest: () -> Unit? = null, popoverContent: @Composable BoxScope.() -> Unit)

Icon button with Popover (Tab tip Popover)

Buttons are used to initialize an action. Button labels express what action will occur when the user interacts with it.

Icon buttons allow users to take actions, and make choices, with a single tap. Icon buttons can take the form of a primary, secondary, tertiary, or ghost variant but most commonly will be styled as primary or ghost buttons.

This variant of the icon button is wrapped by and displays a Popover when the user click on it. The popover is of the "tab tip" variant.

⚠️ Placement limitations

Due to limitations from Compose, the Popover may be misplaced or misaligned if the current UI window is not big enough to fit it. This is especially the case for hand-held devices. Please keep this in mind when using this component.

From Button documentation, Popover documentation

Parameters

iconPainter

Icon painter to be displayed in the button.

isPopoverVisible

Whether the popover is visible or not.

popoverAlignment

The alignment of the popover relative to this icon button.

onClick

Callback invoked when the button is clicked.

modifier

The modifier to be applied to the button.

popoverMinWidth

Minimum width of the displayed popover.

popoverMaxWidth

Maximum width of the displayed popover.

popoverPopupProperties

PopupProperties for further customization of the underlying popup's behavior.

buttonType

A ButtonType that defines the button's type.

buttonSize

A ButtonSize that defines the button's size.

isEnabled

Whether the button is enabled or disabled.

interactionSource

The MutableInteractionSource that keeps track of the button's state.

onDismissRequest

Executes when the user clicks outside of the popup.

popoverContent

The content to be displayed inside the popup.