Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
GitHub
c

CompositeHtmlAttr

class CompositeHtmlAttr(name: String) extends HtmlAttr[String]

A space-separated token attribute whose repeated modifiers contribute to one rendered value.

Static values, signals, optional signals, and attribute modifiers selected by choose are split on HTML ASCII whitespace. Empty tokens are discarded, exact duplicate tokens retain their first position, and the attribute is omitted when no tokens remain. Ordinary HtmlAttr definitions remain scalar rather than composing.

Defined by scalive.CompositeHtmlAttr. View source (scalive/api/src/scalive/HtmlElement.scala:110-127)

Methods2

:=

def :=(value: String): Mod.Attr[Nothing]

Adds the whitespace-separated tokens of value to the attribute.

This form adds constant tokens, as in cls := "card featured".

Defined by scalive.CompositeHtmlAttr.:=. View source (scalive/api/src/scalive/HtmlElement.scala:115-116)

def :=(value: Signal[String]): Mod.Attr[Nothing]

Adds the whitespace-separated tokens of value to the attribute.

This form adds the tokens that the signal currently holds.

Defined by scalive.CompositeHtmlAttr.:=. View source (scalive/api/src/scalive/HtmlElement.scala:122-123)

optional

def optional(value: Signal[Option[String]]): Mod.Attr[Nothing]

Adds the tokens that the signal holds, and none while it holds None.

Defined by scalive.CompositeHtmlAttr.optional. View source (scalive/api/src/scalive/HtmlElement.scala:126-127)