Catalog ComboBoxes

<.language_picker>

ConnieUI.ComboBoxes

Danish
HEEx
<div class="w-80">
  <ConnieUI.ComboBoxes.language_picker value="da" field={@field} options={@options} />
</div>

Variant matrix

Every combination of one or two attributes, side by side.

Controls

When true, the locale cannot be cleared. See `combo_box/1`.

:string

The locale the document is written in. Required: the badge shown while the picker is unlocked is the only thing that names it.

Set by the example

field options

Docs

Document-language selector with automatic detection. When unlocked (auto-detected), shows the current language read-only as a flag badge with a "Change" action; the Change button emits a `"language:override"` event for the parent editor LiveView to handle (it owns the `locked` state and the CRDT field). When locked, shows a searchable combo box bound to `field`. The host owns the list: which locales a document can be written in, what each is called, its flag, and the sample that tells two variants of one language apart. ## Examples <ConnieUI.ComboBoxes.language_picker field={@form[:locale]} options={Connie.Locale.document_options()} locked={@language_locked} value={@locale} />
Attribute Type Default Description
field * {:struct, Phoenix.HTML.FormField}
options * :list
List of maps with `:id` (the form value), `:name`, `:flag` (or `nil`) and `:sample`. The sample is the subtitle, shown in the list only, so two entries for one language are told apart by how they write a date.
required :boolean false
When true, the locale cannot be cleared. See `combo_box/1`.
locked :boolean false
value * :string
The locale the document is written in. Required: the badge shown while the picker is unlocked is the only thing that names it.
rest :global