# `Cardbox.Field`
[🔗](https://github.com/hattoriai/cardbox/blob/v0.1.0/lib/cardbox/field.ex#L1)

A field of a collection: its `name`, its `type` (`Cardbox.Type`) and
that type's `options`.

`key` is made from the name when the field is added (`"Due date"` is
`due_date`) and never changes: a record keeps its values under their
fields' keys, and a saved view names fields by key, so a field renamed
is renamed everywhere at once. Queries and writes take a field's key or
its name.

# `t`

```elixir
@type t() :: %Cardbox.Field{
  __meta__: term(),
  collection: term(),
  collection_id: integer() | nil,
  description: String.t() | nil,
  id: integer() | nil,
  inserted_at: term(),
  key: String.t(),
  name: String.t(),
  options: map(),
  position: String.t() | nil,
  type: String.t(),
  updated_at: term()
}
```

# `choices`

```elixir
@spec choices(t()) :: [map()]
```

The field's choices, for a select, a multi-select or a status; `[]` for others.

---

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