# `Erabi`
[🔗](https://github.com/hattoriai/erabi/blob/v0.1.0/lib/erabi.ex#L1)

Pickers for Phoenix LiveView: `select`, `multi_select`, `combobox`,
`tags`, `person_picker` and `color_picker`, in `Erabi.Components`.

Each picker is a field of a form: it posts what the browser's own
control would, works with `Phoenix.HTML.FormField` and changesets, and
is the browser's own control until its hook mounts. Its options are
the app's (see `Erabi.Option`), or come from a search on the server
(`Erabi.Live`). Its rules (`Erabi.Rules`) hold in the browser, as people
choose, and on the server, in `Erabi.Changeset`.

# `cell_editor`

```elixir
@spec cell_editor(atom(), keyword()) :: {String.t(), map()}
```

A picker as the editor of a grid's cells, for a column of
[Masu](https://hex.pm/packages/masu): the `editor` of the column, with
its options, rules and words.

    <:col field={:labels} editor={Erabi.cell_editor(:multi_select, options: @labels, max: 3)} />

The browser's half registers the editors once, in the app's JavaScript:

    import { configure } from "masu"
    import { erabiEditors } from "erabi"

    configure({ editors: erabiEditors() })

The kinds are `:select`, `:multi_select`, `:combobox`, `:tags`,
`:person` (with `multiple: true` for several people), `:color` and
`:emoji`. The
options are those of the components: `options`, `rules` and its
shortcuts (`min`, `max`, `create`, `required`), `filter`, `me`,
`placeholder`, `locale` and `messages`; for `:color`, `palette`,
`custom` and `contrast`, as `Erabi.Components.color_picker/1` takes
them; and for `:emoji`, `tones`. A picker of one value saves it as it is chosen; one of several,
when the editor closes, as the grid's own editors do; a color, when its
popup closes, so that a drag in its area saves once.

The color and emoji editors are in their pickers' entries, which the
app imports too (`import "erabi/color"`, `import "erabi/emoji"`);
without them, such a column is a select of its options.

# `options`

```elixir
@spec options(term()) :: [Erabi.Option.t()]
```

The options of anything a picker takes; see `Erabi.Option.list/1`.

---

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