# `MishkaGervaz.Form.Types.Field.Select`
[🔗](https://github.com/mishka-group/mishka_gervaz/blob/v0.0.2/lib/mishka_gervaz/form/types/field/select.ex#L1)

Single-select dropdown field type. Trims string values on sanitize.

## Example

    field :status, :select do
      options [{"Draft", :draft}, {"Published", :published}]
      include_nil "Any"
    end

## Blank choice

A select draws an empty choice ahead of its options according to the field:

  * `ui placeholder` set - the empty choice is labelled with it, required or not
  * `required true`, or a `default` set - no empty choice
  * otherwise - an empty choice labelled "Select..."

See `MishkaGervaz.Form.Behaviours.FieldType` and `MishkaGervaz.Form.Types.Field`.

# `prompt`

```elixir
@spec prompt(map()) :: String.t() | nil
```

The label of the empty choice a form select draws ahead of its options, or `nil` when it draws
none.

Takes the field map (`ui`, `required` and `default` are read from it) and returns the `ui`
placeholder when one is set, `nil` for a required field or one with a default, and the
translated "Select..." for any other.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
