Skip to main content

Home > blockly > Block > getIcon

Block.getIcon() method

Signature:

getIcon<T extends IIcon>(type: IconType<T> | string): T | undefined;

Parameters

ParameterTypeDescription
typeIconType<T> | stringThe type of the icon to retrieve. Prefer passing an IconType for proper type checking when using typescript.

Returns:

T | undefined

The icon with the given type if it exists on the block, undefined otherwise.