@tempots/dom

dataAttr variable

The data object allows to create any data- attributes. Either a literal value or Signal<string> can be passed as a value.

Signature:

dataAttr: {
    [x: string]: (value: Value&lt;string&gt;) =&gt; Renderable;
}

Example

const button = html.button(
  dataAttr.myinfo('something'), // maps to the `data-myinfo` attribute
)