glaze/basecoat/form

Basecoat documentation: https://basecoatui.com/components/form/

The form helpers provide a compact set of primitives for building accessible form layouts with native HTML elements.

Basecoat only styles controls that have their own class (see the input, textarea and select modules) or sit directly inside a field.

Recipe

import glaze/basecoat/form
import glaze/basecoat/input
import glaze/basecoat/button
import lustre/attribute
import lustre/element/html

fn login_form() {
  form.form([], [
    input.email([attribute.placeholder("Email")]),
    input.password([attribute.placeholder("Password")]),
    button.button([], [html.text("Login")]),
  ])
}

Values

pub fn action(url: String) -> attribute.Attribute(msg)
pub fn fieldset(
  attrs: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)
pub fn form(
  attrs: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)
pub fn get() -> attribute.Attribute(msg)
pub fn group(
  attrs: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)
pub fn legend(
  attrs: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)
pub fn method(m: String) -> attribute.Attribute(msg)
pub fn name(n: String) -> attribute.Attribute(msg)
pub fn post() -> attribute.Attribute(msg)
pub fn vertical(
  attrs: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)
✨ Search Document