View Source Moon.Design.Search (Moon v2.77.0)

Textinput with search options. Renders as a Moon.Design.Dropdown. Is designed for usage outside of the forms


  • options :list, required: true - ... format: [page: Module.Name, key: "Name"]
  • disabled :boolean - Set disabled/non-disabled
  • prompt :string - Some prompt to be shown on empty value
  • id :string, required: true - Id of the component
  • size :string, values!: ~w(sm md lg), default: "md" - Common moon size property
  • class :css_class, from_context: :class - Additional classes for the <select> tag
  • testid :string - Data-testid attribute value
  • error :boolean, from_context: :error - Some additional styling will be set to indicate field is invalid
  • is_open :boolean - Should dropdown be open
  • filter :string - Filtering value for the options, appears in input
  • attrs :map, default: %{} - Additional attributes for the option link


  • default - Option for custom stylings - use it to show icons or anything else
  • trigger - Trigger element for the dropdown, default is Dropdown.Select
  • option - Slot used for rendering single option. option[:key] will be used if not given


  • on_keyup - On key up event for the input - use it for filter options
  • on_change - Event that fires when smth is chosen from the dropdown menu



Callback implementation for Surface.Component.render/1.