ExTeal.Fields.MultiSelect (ExTeal v0.21.0) View Source

The MultiSelect field may be used to generate a drop-down menu with multiple fields.

The select menu's options may be defined using the MultiSelect/with_options/2 function:

MultiSelect.make(:regions)
|> MultiSelect.with_options([%{value: 1, label: "USA"}, %{value: 2, label: "EU"}])

You can also return a list of maps with value, title, subtitle and thumbnail keys to use 'card' style taggables, useful when the multiselect represents a relationship.

Link to this section Summary

Link to this section Types

Specs

card_option() :: %{
  :value => :integer | String.t(),
  :title => String.t(),
  optional(:subtitle) => String.t(),
  optional(:thumbnail) => String.t()
}

Specs

simple_option() :: %{value: :integer | String.t(), label: String.t()}

Specs

valid_option() :: simple_option() | card_option()

Specs

valid_options() :: [valid_option()]

Link to this section Functions