HtmlAttrs

com.raquo.laminar.defs.attrs.HtmlAttrs
trait HtmlAttrs

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Laminar

Members list

Value members

Concrete methods

protected def boolAsOnOffHtmlAttr(name: String): HtmlAttr[Boolean]
protected def boolAsTrueFalseHtmlAttr(name: String): HtmlAttr[Boolean]
def htmlAttr[V](name: String, codec: Codec[V, String]): HtmlAttr[V]

Create HTML attribute (Note: for SVG attrs, use L.svg.svgAttr)

Create HTML attribute (Note: for SVG attrs, use L.svg.svgAttr)

Type parameters

V
  • value type for this attr in Scala

Value parameters

codec
  • used to encode V into String, e.g. StringAsIsCodec
name
  • name of the attribute, e.g. "value"

Attributes

protected def intHtmlAttr(name: String): HtmlAttr[Int]
protected def stringHtmlAttr(name: String): HtmlAttr[String]

Concrete fields

lazy val `type`: HtmlAttr[String]

This attribute has several meanings depending on what element it's applied to. It could indicate the type of a button, an input, a script, a stylesheet, etc.

This attribute has several meanings depending on what element it's applied to. It could indicate the type of a button, an input, a script, a stylesheet, etc.

Aliases: typ, tpe

Attributes

lazy val charset: HtmlAttr[String]

Declares the character encoding of the page or script. Used on meta and script elements.

Declares the character encoding of the page or script. Used on meta and script elements.

Attributes

lazy val contentEditable: HtmlAttr[Boolean]

Indicates whether the element should be editable by the user. If so, the browser modifies its widget to allow editing.

Indicates whether the element should be editable by the user. If so, the browser modifies its widget to allow editing.

contentEditable @ MDN

Attributes

lazy val contextMenuId: HtmlAttr[String]

Specifies a context menu for an element by its element id. The context menu appears when a user right-clicks on the element

Specifies a context menu for an element by its element id. The context menu appears when a user right-clicks on the element

contextmenu @ MDN

Attributes

lazy val dropZone: HtmlAttr[String]

Specifies whether the dragged data is copied, moved, or linked, when dropped Acceptable values: copy | move | link

Specifies whether the dragged data is copied, moved, or linked, when dropped Acceptable values: copy | move | link

Attributes

lazy val formAction: HtmlAttr[String]

The formaction attribute provides the URL that will process the input control when the form is submitted and overrides the default action attribute of the form element. This should be used only with input elements of type submit or image.

The formaction attribute provides the URL that will process the input control when the form is submitted and overrides the default action attribute of the form element. This should be used only with input elements of type submit or image.

input#formaction @ MDN

Attributes

lazy val formId: HtmlAttr[String]

The form attribute specifies an ID of the form an <input> element belongs to.

The form attribute specifies an ID of the form an <input> element belongs to.

Attributes

lazy val heightAttr: HtmlAttr[Int]

The height attribute specifies the pixel height of the following elements: <canvas>, <embed>, <iframe>, <img>, <input type="image">, <object>, <video>

The height attribute specifies the pixel height of the following elements: <canvas>, <embed>, <iframe>, <img>, <input type="image">, <object>, <video>

object#height @ MDN

Attributes

lazy val href: HtmlAttr[String]

This is the single required attribute for anchors defining a hypertext source link. It indicates the link target, either a URL or a URL fragment. A URL fragment is a name preceded by a hash mark (#), which specifies an internal target location (an ID) within the current document. URLs are not restricted to Web (HTTP)-based documents. URLs might use any protocol supported by the browser. For example, file, ftp, and mailto work in most user agents.

This is the single required attribute for anchors defining a hypertext source link. It indicates the link target, either a URL or a URL fragment. A URL fragment is a name preceded by a hash mark (#), which specifies an internal target location (an ID) within the current document. URLs are not restricted to Web (HTTP)-based documents. URLs might use any protocol supported by the browser. For example, file, ftp, and mailto work in most user agents.

a#href @ MDN

Attributes

lazy val listId: HtmlAttr[String]

Identifies a list of pre-defined options to suggest to the user. The value must be the id of a FormTags.dataList element in the same document. The browser displays only options that are valid values for this input element. This attribute is ignored when the type attribute's value is hidden, checkbox, radio, file, or a button type.

Identifies a list of pre-defined options to suggest to the user. The value must be the id of a FormTags.dataList element in the same document. The browser displays only options that are valid values for this input element. This attribute is ignored when the type attribute's value is hidden, checkbox, radio, file, or a button type.

Attributes

lazy val maxAttr: HtmlAttr[String]

The max attribute specifies the maximum value for an <input> element of type number, range, date, datetime, datetime-local, month, time, or week.

The max attribute specifies the maximum value for an <input> element of type number, range, date, datetime, datetime-local, month, time, or week.

max @ MDN

Attributes

lazy val minAttr: HtmlAttr[String]

The min attribute specifies the minimum value for an <input> element of type number, range, date, datetime, datetime-local, month, time, or week.

The min attribute specifies the minimum value for an <input> element of type number, range, date, datetime, datetime-local, month, time, or week.

min @ MDN

Attributes

lazy val src: HtmlAttr[String]

Specifies the URL of an image for <img> tag, for type="image" input buttons, or the URL of some other network resources like <iframe>.

Specifies the URL of an image for <img> tag, for type="image" input buttons, or the URL of some other network resources like <iframe>.

Attributes

lazy val stepAttr: HtmlAttr[String]

The step attribute specifies the numeric intervals for an <input> element that should be considered legal for the input. For example, if step is 2 on a number typed <input> then the legal numbers could be -2, 0, 2, 4, 6 etc. The step attribute should be used in conjunction with the min and max attributes to specify the full range and interval of the legal values. The step attribute is applicable to <input> elements of the following types: number, range, date, datetime, datetime-local, month, time and week.

The step attribute specifies the numeric intervals for an <input> element that should be considered legal for the input. For example, if step is 2 on a number typed <input> then the legal numbers could be -2, 0, 2, 4, 6 etc. The step attribute should be used in conjunction with the min and max attributes to specify the full range and interval of the legal values. The step attribute is applicable to <input> elements of the following types: number, range, date, datetime, datetime-local, month, time and week.

step @ MDN

Attributes

lazy val tpe: HtmlAttr[String]
lazy val typ: HtmlAttr[String]
lazy val unselectable: HtmlAttr[Boolean]

IE-specific property to prevent user selection

IE-specific property to prevent user selection

Attributes

lazy val widthAttr: HtmlAttr[Int]

The width attribute specifies the pixel width of the following elements: <canvas>, <embed>, <iframe>, <img>, <input type="image">, <object>, <video>

The width attribute specifies the pixel width of the following elements: <canvas>, <embed>, <iframe>, <img>, <input type="image">, <object>, <video>

object#width @ MDN

Attributes