attr method

ElementBuilder attr(
  1. String name,
  2. Attribute value
)

Generic escape hatch for any attribute.

Use this for attributes not yet supported by Pulsar.

Example:

Div().attr('custom-attribute', 'value')
Div().attr('aria-label', 'Close button')

Implementation

ElementBuilder attr(String name, Attribute value) {
  _attrs[name] = value;
  return this;
}