View Source Moon.Design.Dropdown.Select (Moon v2.89.1)

Element that triggers Dropdown component, renders as a button

Properties

  • testid :string - Data-testid attribute for html tag
  • id :string - Id attribute for html tag
  • class :css_class - Additional CSS classes for the html tag
  • prompt :string, default: "..." - Text to be shown when no value given
  • value :string - Value to be shown
  • badge :integer - Badge to show selected items count or smth else
  • error :boolean, from_context: :error - Some additional styling will be set to indicate field is iinvalid
  • is_open :boolean, from_context: :is_open - If the open indicator is active or not
  • size :string, values!: ~w(sm md lg), from_context: :size - Site of the select
  • disabled :boolean, from_context: :disabled - If the item should be marked as disabled

Slots

  • default - Content of the button

Events

  • on_click, from_context: :on_trigger - Event that fired when trigger is clicked

Summary

Functions

Callback implementation for Surface.Component.render/1.