# Select

The `Select` field renders a `select` field.

```ruby
field :type, as: :select, options: { 'Large container': :large, 'Medium container': :medium, 'Tiny container': :tiny }, display_value: true, placeholder: 'Choose the type of the container.'
```

<Option name="`options`">

A `Hash` representing the options that should be displayed in the select. The keys represent the labels, and the values represent the value stored in the database.

The options get cast as `ActiveSupport::HashWithIndifferentAccess` objects if they are a `Hash`.

#### Default

`nil`

#### Possible values

- `{ 'Large container': :large, 'Medium container': :medium, 'Tiny container': :tiny }` or any other `Hash`.
- A lambda function that returns a `Hash` (computed options)

### Computed options

You may want to compute the values on the fly for your `Select` field. You can use a lambda for that where you have access to the `record`, `resource`, `view`, and `field` properties where you can pull data off.

```ruby{5-7}