Class HtmlElement
Namespace: TinyComponents
Assembly: TinyComponents.dll
Represents an HTML element for rendering
public class HtmlElement : INode
Inheritance
Implements
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Extension Methods
XmlNodeExtensions.SelfClosed<HtmlElement>(HtmlElement), XmlNodeExtensions.WithAttribute<HtmlElement>(HtmlElement, string), XmlNodeExtensions.WithAttribute<HtmlElement>(HtmlElement, string, object?), XmlNodeExtensions.WithAttributes<HtmlElement>(HtmlElement, object?), HtmlElementExtensions.WithClass<HtmlElement>(HtmlElement, params string[]), XmlNodeExtensions.WithContent<HtmlElement>(HtmlElement, Action<HtmlElement>), XmlNodeExtensions.WithContent<HtmlElement>(HtmlElement, object?), XmlNodeExtensions.WithContent<HtmlElement>(HtmlElement, string?), HtmlElementExtensions.WithId<HtmlElement>(HtmlElement, string), HtmlElementExtensions.WithName<HtmlElement>(HtmlElement, string), HtmlElementExtensions.WithStyle<HtmlElement>(HtmlElement, object)
Constructors
Initializes a new instance of the HtmlElement class with no container HTML element.
Initializes a new instance of the HtmlElement class with the specified tag name.
Initializes a new instance of the HtmlElement class with the specified tag name and content.
Initializes a new instance of the HtmlElement class with the specified tag name and content.
HtmlElement(string, Action<HtmlElement>)
Initializes a new instance of the HtmlElement class with the specified tag name.
Properties
Gets or sets the collection of HTML attributes for the element.
Gets or sets the collection of child elements within this element.
Gets or sets the list of CSS classes for the HTML element. Initializes with an empty list. Use this to apply CSS class names to the element.
Gets or sets the ID attribute of the HTML element. Used to uniquely identify the element within the page.
Gets or sets the name attribute of the HTML element. The name is used to reference elements in JavaScript, or to reference form data after a form is submitted.
Gets or sets a value indicating whether the element is self-closing.
Gets or sets the CSS style object used to render the style attribute.
Gets or sets the tab index of the HTML element.
Gets or sets the tag name of the HTML element (e.g., "div", "span").
Gets or sets the tooltip text to display for the HTML element.
Methods
Creates an HtmlElement from the specified emmet template.
Create(string, object?, object?, object?[]?, bool)
Creates an HtmlElement from the specified emmet template and adds the specified style, attributes, and children.
Create(string, Action<HtmlElement>)
Creates an HtmlElement from the specified emmet template and configures it using the specified action.
Formats the specified HTML string format, escaping the string interpolation pieces.
Creates an fragment HtmlElement with specified children.
Creates an fragment HtmlElement with specified self-action.
Represents the protected method which gets the attributes to be rendered.
Renders the HTML element into a string with optional pretty formatting.
English
Русский
Português
Español
Deutsch
中文 (简体)
日本語