# Country Code Selector ✅

{% hint style="success" %}
**RELEASED in v0.1.4**&#x20;
{% endhint %}

<figure><img src="/files/C2zI9bTucluB4tBHww3M" alt=""><figcaption></figcaption></figure>

## Features

* Allow drop-in country code selection for accompanying phone number fields&#x20;
* Show flag, country name and country code&#x20;
* Ability to set default countries&#x20;
  * First default is selected automatically&#x20;
  * Others are at the top of the list&#x20;
* Control the field name submitted with the form&#x20;
* Keyboard support&#x20;
  * Begin typing country name&#x20;
  * Or +country code&#x20;

## Properties&#x20;

| Property          | Type             | Description                                                                                                                    |
| ----------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Name              | Test             | The field name the country code is submitted under.                                                                            |
| Default Countries | Text ( CSV )     | Default country codes to show at the top of the list.  The first one is automatically selected. Defaults to US if unspecified. |
| Searchable        | Boolean          |                                                                                                                                |
| Size              | Variant          | Small, Medium, Large                                                                                                           |
| Display           | Variant          | Inline Block Block                                                                                                             |
| Height            | Text ( Measure ) | Defines the height of the closed control, for precise alignment next to a phone number field.                                  |
| Show Flag         | Boolean          | Choose whether to show the flag                                                                                                |
| Show Dial Code    | Boolean          | Choose whether to show the dial code                                                                                           |
| Debug             | Boolean          | For advanced console logging                                                                                                   |

## Styling&#x20;

Use the Size, Display, and Height properties.&#x20;

{% hint style="warning" %}
No variable styling options currently.&#x20;
{% endhint %}

## Future

* Countries list&#x20;
  * Curated countries list&#x20;
    * Possibly CMS-driven&#x20;
* Auto-detection&#x20;
  * Automatic GeoIP country code selection option&#x20;
* Combine with phone number field&#x20;
  * Support smart formatting and validation internally&#x20;
* Styling&#x20;
  * Flag style options ( rectangular, square, circular )&#x20;
* a11y&#x20;
* Mobile variations&#x20;
  * ? Device-specific &#x20;
* Validation
  * 3rd party validation service integration for automatic phone validation&#x20;
  * Including type-checking for SMS, etc. &#x20;

## Technical Notes&#x20;

### Flag icons

Fonts seem inconsistent and problematic cross-platform.&#x20;

Using icon lib here- \
<https://github.com/lipis/flag-icons>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sygnal.gitbook.io/sygnal-webflow-components/cc/sygnal-forms/country-code-selector.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
