howdy/ui/blocks/sign_up

A sign-up screen: name, email, password, a plan and the terms, with each problem shown beside its field.

sign_up.screen(sign_up.sign_up(
  action: "/sign-up",
  form: sign_up.Form(..sign_up.empty(), email: typed_email),
  errors: [#("email", "Enter an email address.")],
  sign_in: "/sign-in",
))

The form posts name, email, password, plan and, when ticked, terms to action. Check them on the server, and render the form again with what was typed and a message for each field that needs another look. Each message is tied to its field, so a screen reader reads it with the label.

Types

What was typed. The password is never sent back.

pub type Form {
  Form(name: String, email: String, plan: String, terms: Bool)
}

Constructors

  • Form(name: String, email: String, plan: String, terms: Bool)

Values

pub fn card_class() -> css.Class
pub fn classes() -> List(css.Class)

Every class this module uses, for howdy/ui/export.

pub fn empty() -> Form
pub fn form_class() -> css.Class
pub fn screen(card: element.Element(msg)) -> element.Element(msg)

The whole screen, with card in the middle.

pub fn screen_class() -> css.Class
pub fn sign_up(
  action action: String,
  form form: Form,
  errors errors: List(#(String, String)),
  sign_in sign_in: String,
) -> element.Element(msg)

errors pairs a field name with its message.

pub fn title_class() -> css.Class
pub fn wide_class() -> css.Class
✨ Search Document