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
nodesUnion69[]
Returns
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.
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
optionsAssignedNodesOptions
Returns
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's fallback content.
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
optionsAssignedNodesOptions
Returns
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's fallback content.