ag_html/attributes

The Html.Attributes module provides functions for defining DOM attributes for Html values.

Types

An Attribute is a value mapping to a dom attribute, such as href in <a href="http://example.com">click here</a>.

pub opaque type Attribute

Functions

pub fn accept(value: String) -> Attribute
pub fn accept_charset(value: String) -> Attribute
pub fn accesskey(value: String) -> Attribute
pub fn action(value: String) -> Attribute
pub fn align(value: String) -> Attribute
pub fn allow(value: String) -> Attribute
pub fn alt(value: String) -> Attribute
pub fn async(value: String) -> Attribute
pub fn autocapitalize(value: String) -> Attribute
pub fn autocomplete(value: String) -> Attribute
pub fn autofocus(enabled: Bool) -> Attribute
pub fn autoplay(enabled: Bool) -> Attribute
pub fn buffered(value: String) -> Attribute
pub fn capture(value: String) -> Attribute
pub fn challenge(value: String) -> Attribute
pub fn charset(value: String) -> Attribute
pub fn checked(enabled: Bool) -> Attribute
pub fn cite(value: String) -> Attribute
pub fn class(value: String) -> Attribute
pub fn class_list(classes: List(#(String, Bool))) -> Attribute

Build a space-separated list of classes from a list of classes and whether to include it or not.

Examples

class_list([#(“btn”, True), #(“hidden”, isLoggedIn)])

pub fn code(value: String) -> Attribute
pub fn codebase(value: String) -> Attribute
pub fn cols(value: Int) -> Attribute
pub fn colspan(value: Int) -> Attribute
pub fn content(value: String) -> Attribute
pub fn contenteditable(enabled: Bool) -> Attribute
pub fn contextmenu(value: String) -> Attribute
pub fn controls(enabled: Bool) -> Attribute
pub fn coords(value: String) -> Attribute
pub fn crossorigin(value: String) -> Attribute
pub fn csp(value: String) -> Attribute
pub fn datetime(value: String) -> Attribute
pub fn decoding(value: String) -> Attribute
pub fn default(enabled: Bool) -> Attribute
pub fn defer(enabled: Bool) -> Attribute
pub fn dir(value: String) -> Attribute
pub fn dirname(value: String) -> Attribute
pub fn disabled(enabled: Bool) -> Attribute
pub fn download(value: String) -> Attribute
pub fn draggable(enabled: Bool) -> Attribute
pub fn enctype(value: String) -> Attribute
pub fn enterkeyhint(value: String) -> Attribute
pub fn for(value: String) -> Attribute
pub fn form(value: String) -> Attribute
pub fn formaction(value: String) -> Attribute
pub fn formenctype(value: String) -> Attribute
pub fn formmethod(value: String) -> Attribute
pub fn formnovalidate(value: String) -> Attribute
pub fn formtarget(value: String) -> Attribute
pub fn headers(value: String) -> Attribute
pub fn height(value: Int) -> Attribute
pub fn hidden(enabled: Bool) -> Attribute
pub fn high(value: String) -> Attribute
pub fn href(value: String) -> Attribute
pub fn hreflang(value: String) -> Attribute
pub fn http_equiv(value: String) -> Attribute
pub fn icon(value: String) -> Attribute
pub fn id(value: String) -> Attribute
pub fn importance(value: String) -> Attribute
pub fn integrity(value: String) -> Attribute
pub fn ismap(value: String) -> Attribute
pub fn itemprop(value: String) -> Attribute
pub fn keytype(value: String) -> Attribute
pub fn kind(value: String) -> Attribute
pub fn label(value: String) -> Attribute
pub fn lang(value: String) -> Attribute
pub fn language(value: String) -> Attribute
pub fn list(value: String) -> Attribute
pub fn loop(enabled: Bool) -> Attribute
pub fn low(value: String) -> Attribute
pub fn manifest(value: String) -> Attribute
pub fn max(value: String) -> Attribute
pub fn maxlength(value: Int) -> Attribute
pub fn media(value: String) -> Attribute
pub fn method(value: String) -> Attribute
pub fn min(value: String) -> Attribute
pub fn minlength(value: Int) -> Attribute
pub fn multiple(enabled: Bool) -> Attribute
pub fn muted(value: String) -> Attribute
pub fn name(value: String) -> Attribute
pub fn novalidate(enabled: Bool) -> Attribute
pub fn open(enabled: Bool) -> Attribute
pub fn optimum(value: String) -> Attribute
pub fn pattern(value: String) -> Attribute
pub fn ping(value: String) -> Attribute
pub fn placeholder(value: String) -> Attribute
pub fn poster(value: String) -> Attribute
pub fn preload(value: String) -> Attribute
pub fn radiogroup(value: String) -> Attribute
pub fn readonly(enabled: Bool) -> Attribute
pub fn referrerpolicy(value: String) -> Attribute
pub fn rel(value: String) -> Attribute
pub fn render_list(attributes: List(Attribute)) -> StringBuilder
pub fn required(enabled: Bool) -> Attribute
pub fn reversed(enabled: Bool) -> Attribute
pub fn role(value: String) -> Attribute
pub fn rows(value: String) -> Attribute
pub fn rowspan(value: Int) -> Attribute
pub fn sandbox(value: String) -> Attribute
pub fn scope(value: String) -> Attribute
pub fn scoped(value: String) -> Attribute
pub fn selected(value: String) -> Attribute
pub fn shape(value: String) -> Attribute
pub fn simple(name: String, enabled: Bool) -> Attribute

Define a simple attribute that does not have a value in the DOM, such as disabled in <input type="button" disabled>.

pub fn size(value: Int) -> Attribute
pub fn sizes(value: String) -> Attribute
pub fn slot(value: String) -> Attribute
pub fn span(value: String) -> Attribute
pub fn spellcheck(enabled: Bool) -> Attribute
pub fn src(value: String) -> Attribute
pub fn srcdoc(value: String) -> Attribute
pub fn srclang(value: String) -> Attribute
pub fn srcset(value: String) -> Attribute
pub fn start(value: Int) -> Attribute
pub fn step(value: String) -> Attribute
pub fn style(value: String) -> Attribute
pub fn summary(value: String) -> Attribute
pub fn tabindex(value: Int) -> Attribute
pub fn target(value: String) -> Attribute
pub fn title(value: String) -> Attribute
pub fn translate(value: String) -> Attribute
pub fn type_(value: String) -> Attribute
pub fn usemap(value: String) -> Attribute
pub fn value(value: String) -> Attribute
pub fn width(value: Int) -> Attribute
pub fn with_value(name: String, value: String) -> Attribute

Define an attribute with a value in the DOM, such as href in <a href="/home">link</a>.

pub fn wrap(value: String) -> Attribute
Search Document