Void

zio.blocks.html.Dom.Element.Void
sealed trait Void extends Dom, CssSelectable

A sealed trait for void HTML elements that cannot have children.

Void elements accept attributes but reject children at compile time. They self-close when rendered (e.g., ``, <img src="../../..."/>).

Unlike Element, this trait does not extend Dom.Element so it does not inherit apply(DomModifier*) — only attributes can be applied via apply(Attribute, Attribute*).

Subtypes include:

Attributes

Source
Dom.scala
Graph
Supertypes
trait Dom
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
class VoidGeneric

Members list

Value members

Abstract methods

def apply(attr: Attribute, attrs: Attribute*): Void

Attributes

Source
Dom.scala

Attributes

Source
Dom.scala
def tag: String

Attributes

Source
Dom.scala

Attributes

Source
Dom.scala

Inherited methods

def &(other: CssSelectable): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def +(adjacent: CssSelectable): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def >(child: CssSelectable): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def >>(descendant: CssSelectable): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def collect(pf: PartialFunction[Dom, Dom]): List[Dom]

Collects all nodes in the tree matching the given partial function.

Collects all nodes in the tree matching the given partial function.

Traverses the entire tree in depth-first order, applying the partial function to each node and collecting matches.

Value parameters

pf

the partial function to apply; nodes that match contribute their transformed values

Attributes

Returns

a list of matching nodes (or their transformed versions)

Inherited from:
Dom
Source
Dom.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def filter(predicate: Dom => Boolean): Dom

Filters the tree to keep only nodes satisfying the predicate.

Filters the tree to keep only nodes satisfying the predicate.

Removes any node for which the predicate returns false, and recursively filters children. Empty branches collapse to Empty.

Value parameters

predicate

the condition each node must satisfy

Attributes

Returns

a new tree with non-matching nodes removed

Inherited from:
Dom
Source
Dom.scala
def find(predicate: Dom => Boolean): Option[Dom]

Finds the first node in the tree satisfying the predicate.

Finds the first node in the tree satisfying the predicate.

Traverses the tree in depth-first order and returns the first matching node.

Value parameters

predicate

the condition to search for

Attributes

Returns

Some(node) if a match is found, None otherwise

Inherited from:
Dom
Source
Dom.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def isEmpty: Boolean

Checks whether this node renders to empty HTML.

Checks whether this node renders to empty HTML.

Returns true if the node is Empty or a Text with empty content.

Attributes

Returns

true if this node produces no output when rendered

Inherited from:
Dom
Source
Dom.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def nthChild(formula: String): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def nthChild(n: Int): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def part(name: String): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def productElementName(n: Int): String

The name of the n^th^ element of this product, 0-based. In the default implementation, an empty string.

The name of the n^th^ element of this product, 0-based. In the default implementation, an empty string.

Value parameters

n

the index of the element name to return

Attributes

Returns

the name of the specified element

Throws
IndexOutOfBoundsException

if the n is out of range(n < 0 || n >= productArity).

Inherited from:
Product
Source
Product.scala
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala
def productPrefix: String

A string used in the toString methods of derived classes. Implementations may override this method to prepend a string prefix to the result of toString methods.

A string used in the toString methods of derived classes. Implementations may override this method to prepend a string prefix to the result of toString methods.

Attributes

Returns

in the default implementation, the empty string

Inherited from:
Product
Source
Product.scala
def render(indent: Int): String

Renders the DOM tree to a pretty-printed HTML string with indentation.

Renders the DOM tree to a pretty-printed HTML string with indentation.

Text content is HTML-escaped. Script and Style elements render their children without escaping to allow inline code.

Value parameters

indent

the number of spaces per indentation level; if <= 0, behaves like render

Attributes

Returns

formatted HTML with newlines and indentation

Inherited from:
Dom
Source
Dom.scala
def render: String

Renders the DOM tree to a minified HTML string.

Renders the DOM tree to a minified HTML string.

Text content is HTML-escaped. Script and Style elements render their children without escaping to allow inline code.

Attributes

Returns

minified HTML output with no extra whitespace

Inherited from:
Dom
Source
Dom.scala
def renderMinified: String

Renders the DOM tree to a minified HTML string (alias for render).

Renders the DOM tree to a minified HTML string (alias for render).

Attributes

Returns

minified HTML output

Inherited from:
Dom
Source
Dom.scala
def select(selector: CssSelector): DomSelection

Selects all descendant nodes matching the given CSS selector.

Selects all descendant nodes matching the given CSS selector.

Value parameters

selector

the CSS selector to match against

Attributes

Returns

a DomSelection containing all matching descendant nodes

Inherited from:
Dom
Source
Dom.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def transform(f: Dom => Dom): Dom

Transforms every node in the tree using the given function.

Transforms every node in the tree using the given function.

Applies the transformation function to each node in depth-first order, then recursively transforms children of Elements. Suitable for rewriting the tree, e.g., removing nodes, modifying attributes, or simplifying structure.

Value parameters

f

the transformation function to apply to each node

Attributes

Returns

a new tree with all nodes transformed

Inherited from:
Dom
Source
Dom.scala

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def withAttribute(attr: String, value: String): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def withAttribute(attr: String): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def withAttributeContaining(attr: String, value: String): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def withAttributeEnding(attr: String, value: String): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def withAttributePrefix(attr: String, value: String): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def withAttributeStarting(attr: String, value: String): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def withAttributeWord(attr: String, value: String): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def |(other: CssSelectable): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala
def ~(sibling: CssSelectable): CssSelector

Attributes

Inherited from:
CssSelectable
Source
CssSelectable.scala

Inherited and Abstract methods

def canEqual(that: Any): Boolean

Checks whether this instance can possibly equal that.

Checks whether this instance can possibly equal that.

A method that should be called from every well-designed equals method that is open to be overridden in a subclass. See Programming in Scala, Chapter 28 for discussion and design.

Value parameters

that

the value being probed for possible equality

Attributes

Returns

true if this instance can possibly equal that, otherwise false

Inherited from:
Equals
Source
Equals.scala
def productArity: Int

The size of this product.

The size of this product.

Attributes

Returns

for a product A(x,,1,,, ..., x,,k,,), returns k

Inherited from:
Product
Source
Product.scala
def productElement(n: Int): Any

The n^th^ element of this product, 0-based. In other words, for a product A(x,,1,,, ..., x,,k,,), returns x,,(n+1),, where `0 = productArity).

The n^th^ element of this product, 0-based. In other words, for a product A(x,,1,,, ..., x,,k,,), returns x,,(n+1),, where `0 = productArity).

Attributes

Returns

the element n elements after the first element

Inherited from:
Product
Source
Product.scala

Concrete fields

Attributes

Source
Dom.scala