# SiPhoneNumberInputComponent documentation

**Kind:** component

**Selector:** `si-phone-number-input`

```
import { SiPhoneNumberInputComponent } from '@siemens/element-ng/phone-number';
```

```
component SiPhoneNumberInputComponent implements ControlValueAccessor, Validator, OnChanges, SiFormItemControl
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [country](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.component.ts#L108-L108>) | `string \| undefined` |  | ISO\_3166-2 Code of the selected country. |
| [defaultCountry](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.component.ts#L113-L113>) | `string \| undefined` |  | ISO\_3166-2 Code of the country which shall be used on form-control reset. |
| [disabled](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.component.ts#L188-L188>) | `boolean` | `false` | Whether the input is disabled. |
| [errormessageId](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.component.ts#L210-L210>) | `string` | `` `${this.id()}-errormessage` `` | This ID will be bound to the `aria-describedby` attribute of the phone-number-input. Use this to reference the element containing the error message(s) for the phone-number-input. It will be picked by the [SiFormItemComponent](<../SiFormItemComponent/index.html#SiFormItemComponent>) if the phone-number-input is used inside a form item.<br><br>Implements [SiFormItemControl](<index.html#t:SiFormItemControl>) |
| [id](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.component.ts#L103-L103>) | `string` | `` `__si-phone-number-input-${SiPhoneNumberInputComponent.idCounter++}` `` | Unique identifier.<br><br>Implements [SiFormItemControl](<index.html#t:SiFormItemControl>) |
| [labelledby](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.component.ts#L180-L180>) | `string` | `` `${this.id()}-label` `` | ID of the element that labels the phone number input.<br><br>Implements [SiFormItemControl](<index.html#t:SiFormItemControl>) |
| [phoneNumberAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.component.ts#L163-L165>) | `TranslatableString` | `` $localize`:@@SI_PHONE_NUMBER_INPUT.PHONE_NUMBER_INPUT_LABEL:Enter phone number` `` | Text for the phone number input aria-label attribute. |
| [placeholderForSearch](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.component.ts#L130-L132>) | `TranslatableString` | `` $localize`:@@SI_PHONE_NUMBER_INPUT.SEARCH_PLACEHOLDER:Search` `` | Placeholder text for country search input. |
| [readonly](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.component.ts#L195-L195>) | `boolean` | `false` | Whether the input can be focused but not edited. |
| [scrollStrategy](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.component.ts#L120-L120>) | `ScrollStrategy` | `defaultConnectedOverlayScrollStrategy()` | Optional CDK scroll strategy used for the country selection overlay. |
| [searchNoResultsFoundLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.component.ts#L141-L143>) | `TranslatableString` | `` $localize`:@@SI_PHONE_NUMBER_INPUT.SEARCH_NO-RESULTS_FOUND:No results found` `` | Text shown when the country search returns no results. |
| [selectCountryAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.component.ts#L152-L154>) | `TranslatableString` | `` $localize`:@@SI_PHONE_NUMBER_INPUT.SELECT_COUNTRY:Select country` `` | Text for the country dropdown aria-label attribute. |
| [supportedCountries](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.component.ts#L170-L170>) | `readonly string[] \| null \| undefined` |  | List of countries in ISO2 format, from which the user is allowed to select one. If no values are provided, the dropdown will show all known countries. |

#### Output Properties

| Name | Type | Description |
| --- | --- | --- |
| [countryChange](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.component.ts#L108-L108>) | `string \| undefined` | ISO\_3166-2 Code of the selected country. |
| [valueChange](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.component.ts#L198-L198>) | `PhoneDetails` | Emits the selected country, formatted phone number, and its validity when the value changes. |

### Types Documentation

### [TranslatableString](<https://github.com/siemens/element/blob/main/projects/element-translate-ng/translate-types/global.types.ts#L18-L18>)

**Kind:** type alias

```
import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';
```

Represents a translatable string. This can either be a translation key, e.g. `ACTIONS.EDIT` that will be automatically translated when displayed on the UI or a pre-translated string, e.g. `Edit`. Equivalent to a normal string in usage and functionality.

```
type TranslatableString = string & Translatable
```

### [PhoneDetails](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.models.ts#L38-L51>)

**Kind:** interface

```
import type { PhoneDetails } from '@siemens/element-ng/phone-number';
```

Describes the phone number, its validity and associated country information.

```
interface PhoneDetails
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [country](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.models.ts#L42-L42>) (optional) | `CountryInfo` | CountryInfo object containing name, countryCode and isoCode of the phone number. |
| [isValid](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.models.ts#L50-L50>) | `boolean` | Confirms if the phone number is valid or not |
| [phoneNumber](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.models.ts#L46-L46>) (optional) | `string` | Phone number entered by the user. |

### [SiFormItemControl](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-item.control.ts#L14-L38>)

**Kind:** interface

```
import type { SiFormItemControl } from '@siemens/element-ng/form';
```

Common interface for form item controls. Controls that should be connected to [SiFormItemComponent](<../SiFormItemComponent/index.html#SiFormItemComponent>) must implement this interface and must be provided using the [SI\_FORM\_ITEM\_CONTROL](<../../types/SI_FORM_ITEM_CONTROL/index.html#t:SI_FORM_ITEM_CONTROL>) token.

```
interface SiFormItemControl
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [errormessageId](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-item.control.ts#L34-L34>) (readonly) | `string \| Signal<string>` | Generated ID that the [SiFormItemComponent](<../SiFormItemComponent/index.html#SiFormItemComponent>) will assign to the element containing the error messages. Implementations of [SiFormItemControl](<index.html#t:SiFormItemControl>) must generate this ID and assign it to the `aria-describedby` attribute of their focusable elements. |
| [id](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-item.control.ts#L16-L16>) (optional, readonly) | `string \| Signal<string \| undefined>` | The actual id of the control that should be used in the `for` attribute of a label. |
| [isFormCheck](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-item.control.ts#L37-L37>) (optional, readonly) | `boolean` | If the control is meant to be used a checkbox. This affects the label positioning. |
| [labelledby](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-item.control.ts#L27-L27>) (optional, readonly) | `string \| Signal<string \| undefined> \| null` | ID that should be assigned to the label element inside the [SiFormItemComponent](<../SiFormItemComponent/index.html#SiFormItemComponent>).<br><br>If the target control is not of type input, select or button, it cannot be referenced by a label. Instead, aria-labelledby must be used to create a reference to a label. In such a case, an implementation of [SiFormItemControl](<index.html#t:SiFormItemControl>) must provide the id of the label in [labelledby](<index.html#t:SiFormItemControl.labelledby>). [SiFormItemComponent](<../SiFormItemComponent/index.html#SiFormItemComponent>) will apply the id to the label so that it can be used inside the control to reference it in the aria-labelledby attribute. |

### [CountryInfo](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.models.ts#L20-L33>)

**Kind:** interface

```
import type { CountryInfo } from '@siemens/element-ng/phone-number';
```

Describes the country information of the phone number.

```
interface CountryInfo
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [countryCode](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.models.ts#L28-L28>) | `number` | The country dial code |
| [isoCode](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.models.ts#L32-L32>) | `string` | The country ISO code. |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/phone-number/si-phone-number-input.models.ts#L24-L24>) | `string` | The name of the country. |
