glaze/basecoat/radio_group

Basecoat documentation: https://basecoatui.com/components/radio-group/

Radio group helpers for mutually exclusive choices.

Use group to render a fieldset of radio options.

Recipe

import glaze/basecoat/radio_group
import lustre/attribute

fn notification_preference() {
  radio_group.group("notifications", [
    radio_group.item("all", "All new messages", False),
    radio_group.item("direct", "Direct messages only", True),
    radio_group.item("none", "Nothing", False),
  ], [])
}

Values

pub fn checked() -> attribute.Attribute(msg)
pub fn disabled() -> attribute.Attribute(msg)
pub fn group(
  name: String,
  items: List(#(String, String, Bool)),
  attrs: List(attribute.Attribute(msg)),
) -> element.Element(msg)
pub fn invalid() -> attribute.Attribute(msg)
pub fn item(
  name: String,
  value: String,
  label_text: String,
  checked: Bool,
  attrs: List(attribute.Attribute(msg)),
) -> element.Element(msg)
pub fn radio(
  name: String,
  value: String,
  attrs: List(attribute.Attribute(msg)),
) -> element.Element(msg)
Search Document