Table of Contents

Class HTMLSlotElement

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The HTMLSlotElement interface of the Shadow DOM API enables access to the name and assigned nodes of an HTML slot element.

[Value("HTMLSlotElement")]
public class HTMLSlotElement : HTMLElement
Inheritance
HTMLSlotElement
Inherited Members

Remarks

Constructors

HTMLSlotElement()

public HTMLSlotElement()

Properties

Name

The name property of the HTMLSlotElement
interface returns or sets the slot name. A slot is a placeholder inside a web component
that users can fill with their own markup.

[Value("name")]
public string Name { get; set; }

Property Value

string

A string.

Remarks

Methods

Assign(params Union69[])

The assign() method of the HTMLSlotElement interface sets the slot's manually assigned nodes to an ordered set of slottables. The manually assigned nodes set is initially empty until nodes are assigned using assign().

[Value("assign")]
public GlobalObject.Undefined Assign(params Union69[] nodes)

Parameters

nodes Union69[]

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

NOTE

You cannot mix manually (imperative) and named (declarative, automatic) slot assignments. Therefore, for this method to work, the shadow tree needs to have been created with the slotAssignment: "manual" option.

-AttachShadow(ShadowRootInit)

See also on MDN

AssignedElements(AssignedNodesOptions)

The assignedElements() method of the HTMLSlotElement
interface returns a sequence of the elements assigned to this slot (and no
other nodes).

[Value("assignedElements")]
public List<Element> AssignedElements(AssignedNodesOptions options = null)

Parameters

options AssignedNodesOptions

Returns

List<Element>

An array of elements.

Remarks

If the flatten option is set to true, it returns a sequence of both the elements assigned to this slot, as well as the elements assigned to any other slots that are descendants of this slot. If no assigned elements are found, it returns the slot&apos;s fallback content.

See also on MDN

AssignedNodes(AssignedNodesOptions)

The assignedNodes() method of the HTMLSlotElement interface returns a sequence of the nodes assigned to this slot.

[Value("assignedNodes")]
public List<Node> AssignedNodes(AssignedNodesOptions options = null)

Parameters

options AssignedNodesOptions

Returns

List<Node>

An array of nodes.

Remarks

If the flatten option is set to true, it returns a sequence of both the nodes assigned to this slot, as well as the nodes assigned to any other slots that are descendants of this slot. If no assigned nodes are found, it returns the slot&apos;s fallback content.

See also on MDN