HEEx
<div class="w-96">
<ConnieUI.ComboBoxes.timezone field={@field} zones={@zones} />
</div>
Variant matrix
Every combination of one or two attributes, side by side.
Controls
Set by the example
field zones
Docs
Renders a searchable time zone combo box.
The host supplies the zones, since it owns the list and the CLDR labels. When
the field may be left to detection it also passes `automatic`, the text for
what an empty value currently resolves to: that adds an **Automatic** entry
first in the list, with an empty value and that text as its subtitle, and
makes the closed box read "Automatic" while the field is empty.
## Examples
<ConnieUI.ComboBoxes.timezone
field={@form[:timezone]}
zones={Connie.Timezone.options()}
automatic="Central European Summer Time (GMT+02:00), from your browser"
/>
| Attribute | Type | Default | Description |
|---|---|---|---|
| No data found. | |||
| field * | {:struct, Phoenix.HTML.FormField} |
|
|
| zones * | :list |
List of maps with `:id` (the IANA name, used as the value), `:name` and
`:offset`. Name and offset make up the item text, so the closed box still
names the offset; the identifier is the subtitle, shown in the list only.
|
|
| automatic | :string | nil |
What an empty value resolves to. Enables the Automatic entry.
|
| required | :boolean | false |
When true, the zone cannot be cleared. See `combo_box/1`. Leave it false
wherever `automatic` is set, since Automatic *is* the empty value.
|