I am a citizen of
HEEx
<p class="w-md text-md text-primary">
I am a citizen of
<ConnieUI.Forms.country_value
field={@form[:citizenship]}
class="inline-block max-w-full align-middle"
placeholder="Your country" required
/>.
</p>
Variant matrix
Every combination of one or two attributes, side by side.
Controls
Set by the example
field class
Docs
A country, picked by name from a searchable list and stored as its ISO 3166-1
alpha-2 code (`"DK"`), the one value a SmartTag stores.
It is built for a contract body the way `money_value/1` is: the markup lives in
a `<template>` the element copies into place, because a `<div>` inside a
paragraph makes the HTML parser close it, and `white-space` is reset because a
contract paragraph is `break-spaces`. `picker` keeps the country list out of a
body that is redrawn on every keystroke, and `input_name` mirrors the code
into the contract editor's hidden input for the tag.
The names are in the language being rendered (`country_options/0`), so a
document's signer reads them in the document's language.
A required one is refused by the browser until a country is picked.
| Attribute | Type | Default | Description |
|---|---|---|---|
| No data found. | |||
| field * | {:struct, Phoenix.HTML.FormField} |
The stored code.
|
|
| input_name | :string | nil |
A named input elsewhere on the page to mirror the stored code into.
|
| placeholder | :string | nil |
Shown while no country is picked. Defaults to "Select country…", translated.
|
| invalid | :boolean | nil |
Overrides the field's own errors, for a caller with no changeset behind the field.
|
| required | :boolean | false |
|
| picker | :string | nil |
The id of a `country_picker/1` rendered once elsewhere on the page. Without
one the country list is rendered inline.
|
| tone | :string | "default" |
`"signer"` draws the sign page's green ring. See `identity_number/1`.
default | signer
|
| class | :any | "block" |
Replaces the default, rather than adding to it.
|