The ILabIcon interface. Outside of this interface the actual implementation of LabIcon may vary

Implements

Constructors

Properties

_className: string
_loading: boolean
_props: LabIcon.IProps = {}
_svgElement: undefined | null | HTMLElement = undefined

Cache for svg parsing intermediates

  • undefined: the cache has not yet been populated
  • null: a valid, but empty, value
_svgInnerHTML: undefined | null | string = undefined
_svgReactAttrs: any = undefined
_svgReplaced: Signal<LabIcon, void> = ...
_svgstr: string
_uuid: string
name: string

The name of the icon. By convention, the icon name will be namespaced as so:

"pkg-name:icon-name"
react: IReact

A React component that will create the icon.

a string that will be used as the class of the container element. Overrides any existing class

a preexisting DOM element that will be used as the container for the svg element

text that will be displayed adjacent to the icon

a tooltip for the icon

if container is not explicitly provided, this tag will be used when creating the container

optional string naming a builtin icon stylesheet, for example 'menuItem' or statusBar. Can also be an object defining a custom icon stylesheet, or a list of builtin stylesheet names and/or custom stylesheet objects. If array, the given stylesheets will be merged.

See @jupyterlab/ui-components/src/style/icon.ts for details

optional position for the inner svg element

optional size for the inner svg element. Set to 'normal' to get a standard 16px x 16px icon

all additional args are treated as overrides for the CSS props applied to the inner svg element

forwarded to the ref prop of the icon's svg element

Accessors

Methods

  • Optional cleanup function for custom renderers. If the .renderer field of a VirtualELement is set, and if .renderer.unrender is defined, when the element is changed or removed its corresponding DOM element will be passed to this function immediately before it is removed from the DOM.

    unrender is not required for for simple renderers, such as those implemented using document.createElement(). However, for certain rendering techniques explicit cleanup is required in order to avoid resource leaks.

    For example, if render calls ReactDOM.render(..., host), then there has to also be a corresponding implementation of unrender that calls ReactDOM.unmountComponentAtNode(host) in order to prevent a memory leak.

    Parameters

    Returns void