View Source Moon.Design.Dropdown.Option (Moon v2.76.3)

Single oprion for the dropdown component. Renders as a button


  • testid :string - Data-testid attribute for button
  • id :string - Id attribute for buttons
  • title :string - Title to be shown when no default slot is given
  • class :css_class - Additional CSS classes for the button tag
  • disabled :boolean - If the button is disabled
  • value :any, from_context: :value - Value of the option, in most cases got from context
  • is_selected :boolean, from_context: :is_selected - If the option is selected, in most cases got from context
  • size :string, values!: ~w(sm md lg), from_context: :size - Text size & paddings for the option. Is set by Dropdown.Options in most cases


  • default - Inner content of the option


  • on_click, from_context: :on_click - On click event, in most cases got from context



Callback implementation for Surface.Component.render/1.