icon(image_path)

Class: UIComponent.

Description:

Sets or gets an icon image of this component. You can set icon to any component even though not all components display the icon.
When a component is added to Tabs, that component's icon is used as a Tab icon by default.
Following image types are supported: ICO, PNG, JPG, JPEG, GIF, BMP, WBMP, TIFF/TIF, and base64 encoded images of such types.
If FFMPEG with support of these image types is installed, the following image types are also supported from local relative or absolute paths: WEBP, HEIC, HEIF, AVIF.

Parameters:

Name Type Description

image_path

string | null

Relative or absolute path to image file, base64 encoded image string, or NULL to remove existing icon.

Returns:

Returns this component if no arguments are set, a string of a previously set icon, or null if icon hasn't been set.

Type: this | string | null