glaze/basecoat/select

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

Select helpers for choosing one option from a list.

This module styles the native <select> element.

Recipe

import glaze/basecoat/select

fn my_select() {
  select.select([select.name("fruit")], [
    select.optgroup("Fruits", [
      select.option("apple", "Apple", True),
      select.option("banana", "Banana", False),
    ]),
  ])
}

Values

pub fn disabled() -> attribute.Attribute(msg)
pub fn full_width() -> attribute.Attribute(msg)
pub fn multiple() -> attribute.Attribute(msg)
pub fn name(n: String) -> attribute.Attribute(msg)
pub fn optgroup(
  label: String,
  children: List(element.Element(msg)),
) -> element.Element(msg)
pub fn option(
  value: String,
  label: String,
  selected: Bool,
) -> element.Element(msg)
pub fn option_disabled(
  value: String,
  label: String,
) -> element.Element(msg)
pub fn option_with_attrs(
  value: String,
  label: String,
  selected: Bool,
  attrs: List(attribute.Attribute(msg)),
) -> element.Element(msg)
pub fn placeholder(p: String) -> attribute.Attribute(msg)
pub fn required() -> attribute.Attribute(msg)
pub fn select(
  attrs: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)
pub fn width(w: String) -> attribute.Attribute(msg)
Search Document