# `MishkaGervaz.Form.Types.Field.Relation`
[🔗](https://github.com/mishka-group/mishka_gervaz/blob/v0.0.1-alpha.3/lib/mishka_gervaz/form/types/field/relation.ex#L1)

Relation field type for selecting related records in forms.

Follows the same pattern as `MishkaGervaz.Table.Types.Filter.Relation`.

## Modes
- `:static` - Load all options at once (default, for small datasets)
- `:load_more` - Paginated with "Load more" button
- `:search` - Searchable single select
- `:search_multi` - Searchable multi select

## Examples

    field :site_id, :relation do
      mode :static
      display_field :name
    end

    field :category_id, :relation do
      mode :search_multi
      search_field :name
      min_chars 1
    end

See `MishkaGervaz.Form.Behaviours.FieldType`,
`MishkaGervaz.Form.Types.Field`, and the table-side counterpart
`MishkaGervaz.Table.Types.Filter.Relation`.

# `render_input`

```elixir
@spec render_input(map(), map(), map(), module()) :: Phoenix.LiveView.Rendered.t()
```

Renders the relation field input by building assigns and calling the UI adapter.

Delegates to the appropriate UI adapter function based on mode:
- `:static` → `ui.select/1`
- `:search` → `ui.search_select/1`
- `:load_more` → `ui.load_more_select/1`
- `:search_multi` → `ui.multi_select/1`

---

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