gbr/ui/admin/select

Gleam UI input select super element.

Types

Select super element.

pub opaque type UISelect

Select item (option) type.

pub type UISelectItem {
  UISelectItem(value: String, label: String, selected: Bool)
}

Constructors

  • UISelectItem(value: String, label: String, selected: Bool)

Select render type.

pub type UISelectRender(a) {
  UISelectRender(
    in: UISelect,
    onchange: option.Option(fn(String) -> a),
  )
}

Constructors

Values

pub fn at(in: UISelect) -> UISelectRender(a)
pub fn items(in: UISelect, items: List(UISelectItem)) -> UISelect

Set select items (options).

pub fn label(in: UISelect, label: typo.UITypo) -> UISelect

Set select title.

pub fn multi(in: UISelect, multi: Bool) -> UISelect

Set select multi items can selected.

pub fn new(id: String) -> UISelect

Constructor of select super element.

pub fn onchange(
  at: UISelectRender(a),
  onchange: fn(String) -> a,
) -> UISelectRender(a)
pub fn placeholder(in: UISelect, placeholder: String) -> UISelect
pub fn render(at: UISelectRender(a)) -> element.Element(a)

Render select super element to lustre/element.{type Element}.

pub fn selected(in: UISelect, value: String) -> UISelect

Update select based by event occurs.

Search Document