lustre/element/html

Values

pub fn a(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

When paired with the href attribute, the <a> element creates a hyperlink to another page, file, or email address.

The content inside an <a> element should accurately describe where the link goes, without relying on any surrounding text or context. For example, a common misuse is using link text link “here” or “read more.” For screen readers or users navigating using the keyboard, just having this text announced provides no indication of where the link will take them.

Common attributes include: download, href, hreflang, ping, referrerpolicy, rel, target, and type.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a

pub fn abbr(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <abbr> element makes it possible to provide an abbreviation or acronym for a term in an accessible way. When paired with the title, you can provide the full description of the term that users can reveal by hovering over the element or be announced by assistive technologies.

Common attributes include: title.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/abbr

pub fn address(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

One of many semantic HTML elements that make your content more-accessible and easier to understand for search engines and other automations. The <address> element contains contact information for a person, group, or organisation. This may be a physical address, but it may also be an email address, phone number, URL, social media handle, or any other form of contact information.

Semantically, the <address> element provides contact information for its furthest <article> or <body> ancestor, and should not be used to provide general contact information unrelated to those elements.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/address

pub fn area(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)

The <area> element defines a clickable area within a <map> element.

Common attributes include: alt, coords, href, download, href, interestfor, ping, referrerpolicy, rel, shape, and target.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/area

pub fn article(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

An <article> represents self-contained content that could be independently understood or distributed without the context of the rest of the document. Although the name of the element implies long-form content, its suitable for a wide range of content such as forum posts, product cards, and other small widgets.

Articles may be nested. For example a weather card could be an <article> containing multiple nested <article> elements for each daily forecast.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article

pub fn aside(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <aside> element represents content that is tangentially related to the main content of the document, such as sidebars, pull quotes, or ads.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/aside

pub fn audio(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

You can use the <audio> element to embed sound and music content in a Web page. When combined with the <source> element, you can provide multiple audio sources to handle browsers with different levels of support.

Common attributes include: autoplay, controls, controlslist, crossorigin, disableremoteplayback, loop, preload, and src.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio

pub fn b(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <b> element represents text that should draw the users attention without implying any added importance or emphasis. It is commonly used to highlight keywords or product names.

The <b> element is one of many elements that can be used to attach additional semantics to a piece of text:

  • <cite> for citing a reference or source.
  • <em> for adding emphasis.
  • <i> to indicate a different voice or mood.
  • <mark> for highlighting text.
  • <strong> to indicate greater importance.
  • <u> for non-textual annotations.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/b

pub fn base(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)

The <base> element lets you change the base URL for all relative URLs in the document.

Common attributes include: href and target.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base

pub fn bdi(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

You can use the <bdi> element to embed text that may have a different text directionality than the surrounding content, such as embedding an Arabic quotation within a paragraph of English text.

Common attributes include: dir.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/bdi

pub fn bdo(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <bdo> element allows you to override the content’s directionality of text, for example to write a paragraph of English text in reverse.

Common attributes include: dir.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/bdo

pub fn blockquote(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

Use the <blockquote> element to render an extended or visually distinct quotation.

Common attributes include: cite

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote

pub fn body(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <body> element contains the human-readable content of an HTML document. It is always a direct child of the <html> element and should be accompanied by a single <head> element.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body

pub fn br(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)

The <br> element is used to insert a line break in a paragraph or block of text for stylistic purposes.

It is important not to use the <br> element to (visually) create separate paragraphs of text as this greatly harms accessibility. You should only use the <br> element where it is stylistically appropriate, such as in a poem or when writing out an address.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/br

pub fn button(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn canvas(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)
pub fn caption(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn cite(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <cite> element can be used to reference the title of a creative work, such as a book, a film, or a blog post. It is commonly used in tandem with the <blockquote> or <q> elements to provide attribution.

The <cite> element is one of many elements that can be used to attach additional semantics to a piece of text:

  • <b> to draw additional attention.
  • <em> for adding emphasis.
  • <i> to indicate a different voice or mood.
  • <mark> for highlighting text.
  • <strong> to indicate greater importance.
  • <u> for non-textual annotations.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/cite

pub fn code(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <code> element is used to represent a fragment of computer code, such as a function name or a variable, embedded in a larger block of text.

To include larger snippets of code or entire files, you can wrap a <code> element inside a <pre> element.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/code

pub fn col(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)
pub fn colgroup(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn data(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

You can use the <data> element to provide a machine-readable value for a piece of content, such as a product id or numerical value.

Note that when representing a date or time, the <time> element must be used instead.

Common attributes include: value.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/data

pub fn datalist(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn dd(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <dd> element provides a description or definition for a preceding term in a description list.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dd

pub fn del(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn details(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <details> element, also known as a “disclosure”, provides a control to show or hide additional content. It should contain a <summary> element as its first child which is always visible and serves as the accessible description of the content that will be revealed.

Common attributes include: open.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/details

pub fn dfn(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <dfn> element is used to indicate the term that is being defined in an enclosing paragraph. You should use this when you’re introducing a new term with a definition.

Common attributes include: title.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dfn

pub fn dialog(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <dialog> element is a container for content that sits above the document, such as modals, inspectors, or control panels. For modals, the dialog must be opened imperatively by calling the showModal() method instead of relying on the open attribute.

Common attributes include: closedby and open.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dialog

pub fn div(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

A <div> is a generic container with no special meaning or semantics. These elements are primarily used for grouping and styling content with CSS.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div

pub fn dl(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn dt(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <dt> element represents a term in a description list that will be defined by a subsequent <dd> element.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dt

pub fn em(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <em> element indicates stress or emphasis of the enclosed text. Browsers will typically style <em> elements with italicised text, but it’s important not to use <em> purely for styling purposes. A good rule of thumb is to consider how the text would be read aloud

The <em> element is one of many elements that can be used to attach additional semantics to a piece of text:

  • <b> to draw additional attention.
  • <cite> for citing a reference or source.
  • <i> to indicate a different voice or mood.
  • <mark> for highlighting text.
  • <strong> to indicate greater importance.
  • <u> for non-textual annotations.

<em> elements can be nested inside one another, communicating greater levels of emphasis.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/em

pub fn embed(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)

The <embed> element is a general container for external (typically non-HTML) content. In modern HTML, this element is typically superceded by more-specific elements such as <image> or <video>.

Common attributes include: height, src, type_, and width.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/embed

pub fn fieldset(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn figcaption(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <figcaption> element is used inside a <figure> to provide a caption or legend for the figure. It is also used by assistive technologies to provide a description of the figure and is therefore important to include when content such as a chart would otherwise lack a textual description.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption

pub fn figure(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <figure> element is used to represent self-contained content such as an image or code snippet that is referenced in the main content but could be understood independently too.

For figures containing charts, code snippets, quotes, or other content that may not have an inherent textual description, it is important to include a <figcaption> element to provide a description for assistive technologies.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure

pub fn footer(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <footer> element can be used to include author information, copyright notices, links to related documents, and other information about the containing document or sectioning element (such as an <article> or <section>).

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/footer

pub fn form(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn h1(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The heading elements <h1> through <h6> represent the six levels of section headings in a document. Headings are a crucial navigation aid for screen readers and as such it is important that headings correctly form a hierarchical structure without skipping levels.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/heading_elements

pub fn h2(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The heading elements <h1> through <h6> represent the six levels of section headings in a document. Headings are a crucial navigation aid for screen readers and as such it is important that headings correctly form a hierarchical structure without skipping levels.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/heading_elements

pub fn h3(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The heading elements <h1> through <h6> represent the six levels of section headings in a document. Headings are a crucial navigation aid for screen readers and as such it is important that headings correctly form a hierarchical structure without skipping levels.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/heading_elements

pub fn h4(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The heading elements <h1> through <h6> represent the six levels of section headings in a document. Headings are a crucial navigation aid for screen readers and as such it is important that headings correctly form a hierarchical structure without skipping levels.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/heading_elements

pub fn h5(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The heading elements <h1> through <h6> represent the six levels of section headings in a document. Headings are a crucial navigation aid for screen readers and as such it is important that headings correctly form a hierarchical structure without skipping levels.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/heading_elements

pub fn h6(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The heading elements <h1> through <h6> represent the six levels of section headings in a document. Headings are a crucial navigation aid for screen readers and as such it is important that headings correctly form a hierarchical structure without skipping levels.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/heading_elements

pub fn head(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <head> element contains metadata and links to other resources like scripts and stylesheets. The content of the <head> element is not displayed to the user but is instead is provided for machine processing.

When server rendering a page with Lustre, it’s important to always start with the <html> element and its two child elements: <head>] and <body>.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/head

pub fn header(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

When not nested within a sectioning element such as <main> or <article>, the <header> element represents a site-wide banner typically containing the site logo, search features, and global navigation.

When nested within a sectioning element, the <header> element becomes a container for introductory content or navigational aids related specifically to that section.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/header

pub fn hgroup(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <hgroup> element can be used to group a single heading element with one or more paragraphs acting as subheadings, alternative titles, or taglines.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hgroup

pub fn hr(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)

The <hr> element marks a thematic break between two elements. It should not be used as a generic divider between elements or controls.

Additionally, the <hr> element may be used inside a <select> to separate groups of options within the dropdown menu.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr

pub fn html(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <html> element is the root of an HTML document. When server rendering a page with Lustre, it’s important to always start with the <html> element and its two child elements: <head> and <body>.

Common attributes include: lang.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/html

pub fn i(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

You can use the <i> element to represent a range of text that is distinct from the surrounding text, such as prose in an alternative voice, internal thoughts, idiomatic phrases from another language (such as et cetera), or technical terms.

The <i> element is one of many elements that can be used to attach additional semantics to a piece of text:

  • <b> to draw additional attention.
  • <cite> for citing a reference or source.
  • <em> for adding emphasis.
  • <mark> for highlighting text.
  • <strong> to indicate greater importance.
  • <u> for non-textual annotations.

By default browsers will style <i> elements with italicised text, and in older HTML specifications the <i> element was used only for styling purposes. In modern HTML, however, it’s important to use this element when its semantics are appropriate.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/i

pub fn iframe(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)

The <iframe> element can be used to embed another HTML document on the current page. It is commonly used to embed widgets from other platforms such as social media posts or video players without requiring JavaScript libraries.

Common attributes include: allow, allowfullscreen, height, loading, name, sandbox, src, srcdoc, and width.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/iframe

pub fn img(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)

You can use the <img> element to embed images in a Web page. You should always include the alt attribute to provide a description of the image for screen readers and other assistive technologies. If the image is purely decorative, it is still important to include the alt attribute with an empty string.

Common attributes include: alt, crossorigin, decoding, elementtiming, fetchpriority, height, ismap, loading, referrerpolicy, sizes, src, srcset, and width.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img

pub fn input(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)
pub fn ins(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn kbd(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <kbd> element represents user input, typically from a keyboard. Common use cases include showing keyboard shortcuts or terminal commands.

<kbd> elements can be nested inside one another to indicate individual key presses or units of input.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/kbd

pub fn label(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn legend(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn li(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <li> element represents one item in an ordered list, an unordered list, or a <menu>. The <li> element must be a direct child of one of these elements in order to be valid HTML.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li

pub fn link(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)

You can use the <link> element to include external resources like stylesheets, fonts, and icons for mobile devices.

Common attributes include: as_, blocking, crossorigin, disabled, fetchpriority, href, hreflang, imagesizes, imagesrcset, integrity, media, referrerpolicy, rel, sizes, title, type_.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link

pub fn main(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <main> element contains the main content of the page. It should be content unique to that page and not include shared or repeated elements like sidebars or navigation menus.

There should only be one visible <main> element on the page.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/main

pub fn map(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <map> element, used in conjunction with an <img> and any number of <area> elements, defines multiple clickable regions on an image.

Common attributes include: name.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/map

pub fn mark(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <mark> element represents a fragment of text which is highlighted for reference purposes. You can imagine this element functioning similar to using a highlighter when taking notes or reading a document. The <mark> element is one of many elements that can be used to attach additional semantics to a piece of text:

  • <b> to draw additional attention.
  • <cite> for citing a reference or source.
  • <em> for adding emphasis.
  • <i> to indicate a different voice or mood.
  • <strong> to indicate greater importance.
  • <u> for non-textual annotations.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/mark

pub fn math(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn menu(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <menu> element is equivalent to the <ul> element and represents an unordered list of items. You might prefer to use this in your markup to contain a list of commands or controls rather than a bulleted list used in prose.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menu

pub fn meta(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)

The <meta> element is used to provide arbitrary metadata about the document that cannot be represented by existing more-specific elements. The kind of metadata being provided depends on which one of the follow attributes is used:

  • name means the element is providing metadata about the entire page, such as the author, its description, or some keywords.

  • http_equiv is used to simulate certain HTTP headers as if the response that returned the HTML document included them.

  • The charset attribute specifies the character encoding for the HTML document.

  • itemprop is used to specify machine-readable microdata that may be used by search engines and crawlers to better-understand the content.

Common attributes include: charset, content, http_equiv, media, name, itemprop.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta

pub fn meter(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn nav(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <nav> element represents content whose primary purpose is to provide links to content either on the page or elsewhere. Using the <nav> element where appropriate can help screen readers and other user agents better-present the page by, for example, omitting navigational content from the main reading flow.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav

pub fn noscript(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn object(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)

Like <embed>, the <object> element describes an external resource that the browser may embed on the page. In many cases this element is superceded by more-specific elements such as <image> or <iframe>, but in some contexts it may be used to embed PDFs in browsers that support it.

Common attributes include: data, form, height, name, type_, and width.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/object

pub fn ol(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <ol> element represents an ordered list of content such that rearranging the items would change or destroy the meaning of the list.

Common attributes include: reversed, start, and type.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol

pub fn optgroup(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn option(
  attrs: List(attribute.Attribute(message)),
  label: String,
) -> element.Element(message)
pub fn output(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn p(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <p> element represents a paragraph of text. Breaking your content up into separate paragraphs improves readability for sighted users, but also improves the experience for users of assistive technologies too as it makes it possible to quickly skim through the content.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p

pub fn picture(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <picture> element contains zero or more <source> elements and one <img> element. This lets you provide different images for device screen sizes, or provide the same image in multiple formats for wider browser support.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/picture

pub fn portal(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)
pub fn pre(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

You can use the <pre> element to display text exactly as it is provided, without any additional formatting or interpretation. The <pre> element is commonly used as a container for semantic elements such as [<code>] or <samp>.

Because the formatting of <pre> text is typically an important part of its meaning, you should think about how users of screen readers and other assistive technologies will understand your content. One common approach is to wrap the <pre> element in a <figure> element and then provide a descriptive <figcaption> that can be read by assistive technologies.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre

pub fn progress(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn q(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <q> element is the inline version of <blockquote> and is used to embed a short inline quotation in the surrounding text.

Common attributes include: cite.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/q

pub fn rp(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <rp> element is used in combination with the <ruby> and <rt> elements to render ruby annotations properly. You should use the <rp> element to wrap <rt> annotations in parentheses.

The browser will correctly omit these parenthesis if it supports ruby annotations, while providing a fallback for browsers that do not.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/rp

pub fn rt(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

You should use the <rt> element in combination with the <ruby> at <rp> elements to provide ruby annotations for East Asian typography, for example by providing Japanese furigana or Chinese pinyin.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/rt

pub fn ruby(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <ruby> element is used in combination with the <rt> and <rp> elements to wrap East Asian typography with annotations such as Japanese furigana or Chinese pinyin.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/ruby

pub fn s(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <s> element represents text that is no longer accurate or relevant. Browsers typically render this as strikethrough text.

To represent document edits you should use the <del> and <ins> elements instead.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/s

pub fn samp(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <samp> element is used to represent example or quoted output from a computer program, such as the output of a command-line tool or a code snippet.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/samp

pub fn script(
  attrs: List(attribute.Attribute(message)),
  js: String,
) -> element.Element(message)
pub fn search(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <search> sectioning element identifies its content as a collection of controls or other content specifically related to search or filtering functionality.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/search

pub fn section(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

A <section> is the most general sectioning element. It represents a standalone section of content without any additional semantics. Because of that, it’s important that each <section> always has a heading to identify its content.

Before using a <section>, consider whether a more-specific element can be used such as <article>, <aside>, <main>, or <nav>.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/section

pub fn select(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn slot(
  attrs: List(attribute.Attribute(message)),
  fallback: List(element.Element(message)),
) -> element.Element(message)

The <slot> element acts as a placeholder or hole inside a shadow DOM tree. Slots are how content is passed into a custom element or a Lustre component. By giving the slot a name, a custom element can specify multiple holes for content to be slotted into.

The children rendered inside a <slot> element are used as fallback content when no content has been assigned to the slot by a parent element.

Common attributes include: name.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/slot

pub fn small(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

You can use the <small> element to represent small print like copyright or legal notices.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/small

pub fn source(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)

The <source> element specifies one or more media resources for a <picture>, <audio>, or <video> element. Because the browser automatically chooses the first source it supports, multiple <source> elements can be used to link to more-modern file formats while providing graceful fallback options for older browsers.

Common attributes include: height, media, sizes, src, srcset, type_, and width.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/source

pub fn span(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <span> element is a generic container for inline content that does not have any intrinsic semantics. When you want to change the presentation of some inline text and no semantic HTML element is appropriate, you can use a <span> to wrap the content and apply CSS styles as appropriate.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/span

pub fn strong(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

You should use the <strong> element to convey importance or urgency. The <strong> element is one of many elements that can be used to attach additional semantics to a piece of text:

  • <b> to draw additional attention.
  • <cite> for citing a reference or source.
  • <em> for adding emphasis.
  • <i> to indicate a different voice or mood.
  • <mark> for highlighting text.
  • <u> for non-textual annotations.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/strong

pub fn style(
  attrs: List(attribute.Attribute(message)),
  css: String,
) -> element.Element(message)

The <style> element is used to embed CSS styles on the page without linking to an external stylesheet. Style elements are most commonly placed in the <head> of the document, but can also appear elsewhere in the <body> when making use of the @scope rule.

Common attributes include: blocking, media, nonce, title.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style

pub fn sub(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

You can use the <sub> element to represent subscript text when marking up footnotes, chemical formulas, or mathematical expressions.

This element should only be used for typographic purposes: in cases where subscript text is desired for purely presentation purposes, CSS should be used instead.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/sub

pub fn summary(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <summary> element provides the interactive toggle for a <details> element. This element is used as the accessible description of a <details> element so it’s important that its content describes or summarises whatever the <details> element contains.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/summary

pub fn sup(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

You can use the <sup> element to represent superscript text such as exponents in mathematical expressions or ordinal numbers.

This element should only be used for typographic purposes: in cases where superscript text is desired for purely presentation purposes, CSS should be used instead.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/sup

pub fn svg(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn table(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn tbody(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn td(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn template(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <template> element holds HTML that is not immediately rendered, and instead can be cloned by JavaScript or used when server-rendering a custom element.

Common attributes include: shadowrootmode, shadowrootclonable, shadowrootdelegatesfocus, and shadowrootserializable.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/template

pub fn text(content: String) -> element.Element(message)

Renders a plain text node. For example, to produce the following HTML…

<h1>
  Hello, Lucy!
</h1>

… you would write:

html.h1([], [
  html.text("Hello, Lucy!"),
])
pub fn textarea(
  attrs: List(attribute.Attribute(message)),
  content: String,
) -> element.Element(message)
pub fn tfoot(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn th(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn thead(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn time(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <time> element is used to provide a machine-readable date or time for human-readable content such as a dates, times, or durations.

Common attributes include: datetime.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/time

pub fn title(
  attrs: List(attribute.Attribute(message)),
  content: String,
) -> element.Element(message)

The <title> element should appear in the <head> of every HTML document. It is displayed in the browser’s title bar, used by search engines, and announced by accessibility tools.

The content of the <title> element should be plain text and any HTML tags will be ignored.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/title

pub fn tr(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)
pub fn track(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)

You can use one or more <track> elements as children of either the <audio> or <video> elements to provide timed subtitles or closed captions.

Captions should be marked up using the WebVTT format.

Common attributes include: default, kind, label, src, and srclang.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track

pub fn u(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <u> element is used to provide non-textual annotations such as labeling a spelling mistake or providing a Chinese proper name mark. The <u> element is one of many elements that can be used to attach additional semantics to a piece of text:

  • <b> to draw additional attention.
  • <cite> for citing a reference or source.
  • <em> for adding emphasis.
  • <i> to indicate a different voice or mood.
  • <mark> for highlighting text.
  • <strong> to indicate greater importance.

While browsers typically render <u> elements with an underline, it is important not to use this element for presentation purposes.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/u

pub fn ul(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

The <ul> element represents an unordered list of content such that the order of the items does not carry any special meaning. It is equivalent to the <menu> element but may be preferable in prose and other content where a bulleted list makes more sense than a menu of options.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul

pub fn var(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

You can use the <var> element to indicate the name of a variable when referencing computer code or writing a mathematical expression.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/var

pub fn video(
  attrs: List(attribute.Attribute(message)),
  children: List(element.Element(message)),
) -> element.Element(message)

You can use the <video> element to embed a video in a Web page.

Common attributes include: autoplay, controls, controlslist, crossorigin, disablepictureinpicture, disableremoteplayback, height, loading, eager, lazy, loop, muted, playsinline, poster, preload, src, and width.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video

pub fn wbr(
  attrs: List(attribute.Attribute(message)),
) -> element.Element(message)

The <wbr> element hints to the browser where it may optionally break up a word to improve line breaking. This is useful in cases where the line breaking rules would otherwise prevent a line break at a desirable location.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/wbr

✨ Search Document