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
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
Static
Private
_debugStatic
Private
_instancesProtected
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
_initOptional
__namedParameters: { Optional
title?: stringOptional
uuid?: stringCreate 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.
The actual DOM node created for a VirtualElement during rendering.
On render, host is created and its attrs are set/updated via the standard routines in updateContent. host is then handed off to this function.
The render function is free to modify host. The only restriction is is that render should not modify any attributes set by external routines (ie updateContent), as this may cause thrashing when the virtual element is next 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.
the DOM element to be removed.
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.
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
toggleGenerated using TypeDoc
The ILabIcon interface. Outside of this interface the actual implementation of LabIcon may vary