Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • LabIcon

Implements

Index

Constructors

constructor

  • new LabIcon(__namedParameters: IOptions & { _loading?: boolean }): LabIcon

  • members *

    Parameters

    • __namedParameters: IOptions & { _loading?: boolean }

    Returns LabIcon

Properties

Protected _className

_className: string

Protected _loading

_loading: boolean

Protected _props

_props: IProps

Protected _svgElement

_svgElement: HTMLElement | null | undefined

Cache for svg parsing intermediates

  • undefined: the cache has not yet been populated
  • null: a valid, but empty, value

Protected _svgInnerHTML

_svgInnerHTML: string | null | undefined

Protected _svgReactAttrs

_svgReactAttrs: any | null | undefined

Protected _svgReplaced

_svgReplaced: Signal<this, void>

Protected _svgstr

_svgstr: string

Protected _uuid

_uuid: string

Readonly name

name: string

Readonly react

react: IReact

A React component that will create the icon.

param

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

param

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

param

text that will be displayed adjacent to the icon

param

a tooltip for the icon

param

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

param

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

param

optional position for the inner svg element

param

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

param

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

param

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

Private Static _debug

_debug: any

Private Static _instances

_instances: any

Accessors

svgElement

  • get svgElement(): HTMLElement | null
  • Returns HTMLElement | null

svgInnerHTML

  • get svgInnerHTML(): string | null
  • Returns string | null

svgReactAttrs

  • get svgReactAttrs(): any | null
  • Returns any | null

svgstr

  • get svgstr(): string
  • set svgstr(svgstr: string): any
  • Returns string

  • Parameters

    • svgstr: string

    Returns any

Methods

Protected _initReact

  • _initReact(displayName: string): React.ForwardRefExoticComponent<IReactProps>
  • Parameters

    • displayName: string

    Returns React.ForwardRefExoticComponent<IReactProps>

Protected _initRender

  • _initRender(__namedParameters: Partial<VirtualElement.IRenderer>): void
  • Parameters

    • __namedParameters: Partial<VirtualElement.IRenderer>

    Returns void

Protected _initSvg

  • _initSvg(__namedParameters?: { title?: string; uuid?: string }): HTMLElement | null
  • Parameters

    • Optional __namedParameters: { title?: string; uuid?: string }
      • Optional title?: string
      • Optional uuid?: string

    Returns HTMLElement | null

bindprops

  • bindprops(props?: IProps): any
  • Get a view of this icon that is bound to the specified icon/style props

    Parameters

    Returns any

    a view of this LabIcon instance

element

  • element(props?: IProps): HTMLElement
  • Create an icon as a DOM element

    Parameters

    Returns HTMLElement

    A DOM element that contains an (inline) svg element that displays an icon

render

  • Parameters

    Returns void

Optional unrender

unrender:

Static remove

  • remove(container: HTMLElement): HTMLElement
  • Remove any rendered icon from the element that contains it

    Parameters

    • container: HTMLElement

      a DOM node into which an icon was previously rendered

    Returns HTMLElement

    the cleaned container

Static resolve

  • Resolve an icon name or a {name, svgstr} pair into an actual LabIcon.

    Parameters

    • __namedParameters: { icon: IResolvable }
      • icon: IResolvable

        either a string with the name of an existing icon or an object with {name: string, svgstr: string} fields.

    Returns LabIcon

    a LabIcon instance

Static resolveElement

  • Resolve 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.

    deprecated

    fallback - don't use, optional, a LabIcon instance that will be used if neither icon nor iconClass are defined

    Parameters

    Returns HTMLElement

    a DOM node with the resolved icon rendered into it

Static resolveReact

  • Resolve 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.

    deprecated

    fallback - don't use, optional, a LabIcon instance that will be used if neither icon nor iconClass are defined

    Parameters

    Returns JSX.Element

    a React component that will render the resolved icon

Static resolveSvg

  • resolveSvg(__namedParameters: IIcon): HTMLElement | null
  • Resolve a {name, svgstr} pair into an actual svg node.

    Parameters

    • __namedParameters: IIcon

    Returns HTMLElement | null

Static toggleDebug

  • toggleDebug(debug?: boolean): void
  • Toggle icon debug from off-to-on, or vice-versa.

    Parameters

    • Optional debug: boolean

      optional boolean to force debug on or off

    Returns void

Generated using TypeDoc