Skip to content

ImageSourceAttribution

ImageSourceAttribution #

Bases: SourceAttribution

An image attribution permanently displayed adjacent to the open/close icon of a RichAttribution control. For it to be displayed, it should be part of a RichAttribution.attributions list.

RAISES DESCRIPTION
AssertionError

If the image is not visible.

data #

data: Any = skip_field()

Arbitrary data of any type that can be attached to a control.

height #

height: Number = 24.0

The height of the image. Should be the same as RichAttribution.permanent_height, otherwise layout issues may occur.

image #

image: Image

The Image to be displayed.

Note

Must be provided and visible.

key #

key: (
    str | int | float | bool | ValueKey | ScrollKey | None
) = None

on_click #

on_click: (
    ControlEventHandler[ImageSourceAttribution] | None
) = None

Fired when this attribution is clicked/pressed.

page #

page: Page | PageView | None

The page (of type Page or PageView) to which this control belongs to.

parent #

parent: BaseControl | None

The direct ancestor(parent) of this control.

It defaults to None and will only have a value when this control is mounted (added to the page tree).

The Page control (which is the root of the tree) is an exception - it always has parent=None.

tooltip #

tooltip: str | None = None

Tooltip text to be displayed when the image is hovered over.

before_event #

before_event(e: ControlEvent)

before_update #

before_update()

did_mount #

did_mount()

init #

init()

is_isolated #

is_isolated()

update #

update() -> None

will_unmount #

will_unmount()