Protected
_classProtected
_loadingProtected
_propsProtected
_svgCache for svg parsing intermediates
Protected
_svgProtected
_svgProtected
_svgProtected
_svgstrProtected
_uuidReadonly
nameThe name of the icon. By convention, the icon name will be namespaced as so:
"pkg-name:icon-name"
Readonly
reactA React component that will create the icon.
a string that will be used as the class of the container element. Overrides any existing class
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 size for the inner svg element. Set to 'normal' to get a standard 16px x 16px icon
Protected
svgProtected
svgProtected
svgA string containing the raw contents of an svg file.
A string containing the raw contents of an svg file.
Protected
_initProtected
_initProtected
_initCreate an icon as a DOM element
A DOM element that contains an (inline) svg element that displays an icon
Customize how a DOM node is rendered. If .renderer is set on a given instance of VirtualElement, this function will be called every time that VirtualElement is rendered.
Optional
options: LabIcon.IRendererOptionsWill be populated with the .attrs and .children fields set on the VirtualElement being rendered.
Optional
unrenderOptional 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.
Optional
options: LabIcon.IRendererOptionsWill be populated with the .attrs and .children fields set on the VirtualElement being unrendered.
Static
removeRemove any rendered icon from the element that contains it
a DOM node into which an icon was previously rendered
the cleaned container
Static
resolveResolve an icon name or a {name, svgstr} pair into an actual LabIcon.
icon: either a string with the name of an existing icon or an object with {name: string, svgstr: string} fields.
a LabIcon instance
Static
resolveResolve an icon name or a {name, svgstr} pair into a DOM element. If icon arg is undefined, the function will fall back to trying to render the icon as a CSS background image, via the iconClass arg. If both icon and iconClass are undefined, this function will return an empty div.
a DOM node with the resolved icon rendered into it
Static
resolveResolve an icon name or a {name, svgstr} pair into a React component. If icon arg is undefined, the function will fall back to trying to render the icon as a CSS background image, via the iconClass arg. If both icon and iconClass are undefined, the returned component will simply render an empty div.
a React component that will render the resolved icon
Static
resolveResolve a {name, svgstr} pair into an actual svg node.
Static
toggle
The ILabIcon interface. Outside of this interface the actual implementation of LabIcon may vary