ui/disclosure

Types

Keyboard messages for disclosure component.

pub type Msg {
  Toggle
}

Constructors

  • Toggle

    Toggle expanded/collapsed state (Enter or Space)

pub type Size {
  Small
  Medium
  Large
}

Constructors

  • Small
  • Medium
  • Large
pub type Variant {
  Default
  Muted
}

Constructors

  • Default
  • Muted

Values

pub fn aria_controls(id: String) -> attribute.Attribute(a)
pub fn aria_expanded(expanded: Bool) -> attribute.Attribute(a)
pub fn aria_label(label: String) -> attribute.Attribute(a)
pub fn disclosure(
  attributes: List(attribute.Attribute(a)),
  children: List(element.Element(a)),
) -> element.Element(a)
pub fn keymap(key_event: keyboard.KeyEvent) -> option.Option(Msg)

Keymap for disclosure keyboard navigation. Follows WAI-ARIA disclosure pattern:

  • Enter: Toggle expanded/collapsed state
  • Space: Toggle expanded/collapsed state
pub fn panel(
  attributes: List(attribute.Attribute(a)),
  children: List(element.Element(a)),
) -> element.Element(a)
pub fn size(s: Size) -> attribute.Attribute(a)
pub fn trigger(
  attributes: List(attribute.Attribute(a)),
  children: List(element.Element(a)),
) -> element.Element(a)
Search Document