HTMLVoidElement
An HTML element that does not contain content.
struct HTMLVoidElement<Tag> where Tag : HTMLTrait.Unpaired
An HTML element that does not contain content.
struct HTMLVoidElement<Tag> where Tag : HTMLTrait.Unpaired
import Elementary
enum HTMLTrait
A namespace for trait protocols that control the behavior a capabilities of HTML elements.
protocol Unpaired : HTMLTagDefinition, HTMLTrait.Attributes.Global
A marker that indicates that an HTML tag is unpaired.
protocol HTML<Tag>
A type that represents HTML content that can be rendered.
init()
Creates a new HTML void element.
init(_ attribute: HTMLAttribute<Tag>)
Creates a new HTML void element with the specified attribute.
init(_ attributes: HTMLAttribute<Tag>...)
Creates a new HTML void element with the specified attributes.
init(attributes: [HTMLAttribute<Tag>])
Creates a new HTML void element with the specified attributes.
static func _render<Renderer>(_ html: consuming Self, into renderer: inout Renderer, with context: consuming _RenderingContext) where Renderer : _HTMLRendering
static func _render<Renderer>(_ html: consuming Self, into renderer: inout Renderer, with context: consuming _RenderingContext) async throws where Renderer : _AsyncHTMLRendering
var _attributes: _AttributeStorage
typealias Tag = Tag
The type of the HTML tag this element represents.
static func _render<Renderer>(_ html: consuming Self, into renderer: inout Renderer, with context: consuming _RenderingContext) where Renderer : _HTMLRendering
static func _render<Renderer>(_ html: consuming Self, into renderer: inout Renderer, with context: consuming _RenderingContext) async throws where Renderer : _AsyncHTMLRendering
var content: Never { get }
func attributes(_ attribute: HTMLAttribute<Tag>, when condition: Bool = true) -> _AttributedElement<Self>
Adds the specified attribute to the element.
func attributes(contentsOf attributes: [HTMLAttribute<Tag>], when condition: Bool = true) -> _AttributedElement<Self>
Adds the specified attributes to the element.
func environment<T>(_ taskLocal: TaskLocal<T>, _ value: T) -> _ModifiedTaskLocal<T, Self> where T : Sendable
Sets the value of a TaskLocal
for the duration of rendering the content.
consuming func render() -> String
Renders the HTML content into a single string.
consuming func render(into writer: some HTMLStreamWriter, chunkSize: Int = 1024) async throws
Renders the HTML content into a stream writer.
consuming func renderAsync() async throws -> String
Renders the HTML content into a single string asynchronously.
consuming func renderFormatted() -> String
Renders the HTML content into a formatted string.
consuming func render(into writer: @escaping (String) -> Void)
protocol Sendable