View Source Backpex.Fields.Select (Backpex v0.6.0)

A field for handling a select value.

Options

  • :options - Required (keyword) list of options or function that receives the assigns.
  • :prompt - The text to be displayed when no option is selected or function that receives the assigns.

Example

@impl Backpex.LiveResource
def fields do
  [
    role: %{
      module: Backpex.Fields.Select,
      label: "Role",
      options: [Admin: admin, User: user]
    }
  ]
end