lucide-cldn - v1.1.0
    Preparing search index...

    Class Sword

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    node: SVGSVGElement

    This component's node

    Methods

    • Insert components in the children list of this ElementComponent’s parent, just after this ElementComponent.

      Parameters

      • ...components: NodeComponent<any>[]

        Components to insert

      Returns this

    • Insert component after the last child

      Parameters

      • ...components: NodeComponent<any>[]

      Returns this

    • Set attribute

      Parameters

      • name: string

        attribute name

      • Optionalvalue: string

        attribute value

      Returns this

    • Insert components in the children list of this ElementComponent’s parent, just before this ElementComponent.

      Parameters

      • ...components: NodeComponent<any>[]

        Components to insert

      Returns this

    • Add classes

      Parameters

      • ...classes: string[]

      Returns this

    • Clone this component. Event listeners are not cloned.

      Parameters

      • Optionaldeep: boolean

        Whether to clone the whole subtree.

      Returns SvgComponent

      A duplicate of this component.

    • Run a function in the context of this component

      Parameters

      • fn: (this: this, component: this) => any

        Provides this component as the first argument and this.

      Returns this

    • Empty the component (remove children)

      Returns this

    • Get element property

      Type Parameters

      • K extends ReadableKeys<SVGSVGElement>

      Parameters

      • name: K

        property name

      Returns SVGSVGElement[K]

    • Check if component has class

      Parameters

      • ...classes: string[]

      Returns boolean

      true if component has all the specified classes

    • Append HTML.

      Any components (provided as ${...} inside the HTML string literal) remain fully functional and are appended (not just as HTML).

      Parameters

      • strings: TemplateStringsArray
      • ...components: any[]

      Returns this

      component.html`<div>${new Component("button")
      .text("Click me")
      .on("click", () => console.log("clicked"))
      }</div>`
      // Event listeners etc. are preserved.
      // Note the lack of parentheses.
    • Add event listener

      Type Parameters

      • K extends keyof ElementEventMap

      Parameters

      • type: K

        A case-sensitive string representing the event type to listen for.

      • listener: (ev: ElementEventMap[K], component: this) => any

        The function that is called when an event of the specified type occurs.

      Returns Sword

    • Add event listener

      Type Parameters

      • K extends keyof ElementEventMap

      Parameters

      • type: K

        A case-sensitive string representing the event type to listen for.

      • listener: (ev: ElementEventMap[K], component: this) => any

        The function that is called when an event of the specified type occurs.

      • options: AddEventListenerOptions

        An object that specifies characteristics about the event listener. See options on MDN

      Returns Sword

    • Add event listener

      Type Parameters

      • K extends keyof ElementEventMap

      Parameters

      • type: K

        A case-sensitive string representing the event type to listen for.

      • listener: (ev: ElementEventMap[K], component: this) => any

        The function that is called when an event of the specified type occurs.

      • useCapture: boolean

      Returns Sword

    • Insert component before the first child

      Parameters

      • ...components: NodeComponent<any>[]

      Returns this

    • Remove the element

      Returns this

    • Remove attribute

      Parameters

      • name: string

        attribute name

      Returns this

    • Remove classes

      Parameters

      • ...classes: string[]

      Returns this

    • Replace classes

      Parameters

      • oldClasses: string | string[]

        If all of these classes are present, they will be removed.

      • newClasses: string | string[]

        The classes to add if all oldClasses are present

      Returns this

    • Set element property

      Type Parameters

      • K extends WritableKeys<SVGSVGElement>

      Parameters

      • name: K

        property name

      • value: SVGSVGElement[K]

        property value

      Returns this

    • Render this component in the place of a <slot name="…"></slot>.

      Parameters

      • slot: string

        The slot name

      • Optionalparent: ParentNode

        The parent element within to search for slots. Defaults to document

      Returns this

      !DOMException When the slot is not found

    • Set text content

      Parameters

      • text: string

      Returns this

    • Toggle classes

      Parameters

      • ...classes: string[]

      Returns this

    • Get this component's outer HTML

      Returns string

    • Create SVG component from <svg>...</svg> code

      Parameters

      • svg: string

      Returns SvgComponent