> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Phone

## Article: Phone

## Article Link: https://dev.wix.com/docs/site-extensions/editor-react-components/editor-react-types/reference/phone.md

## Article Content:

import { Property, PropertyList, ExpandableSection } from "@wix/docs-ui/content";

# Phone

A phone number string accepting common phone number characters, including digits, spaces,
parentheses, a plus sign, hyphens, and periods. Use it for a field that holds a contact number. For example, `'+1 (555) 123-4567'`.

## Component

In your component code, import the `Phone` type from `@wix/editor-react-types`:

```ts
import type { Phone } from '@wix/editor-react-types';
```

At runtime it's a plain string:

```ts
type Phone = string
```

### Usage

Your code either consumes a value of type `Phone` or produces one:

::::tabs
:::Consumers
In a component that receives a `Phone`, apply it to a `tel` anchor:

```tsx
import type { Phone } from '@wix/editor-react-types';

function CallLink({ phoneNumber }: { phoneNumber?: Phone }) {
  return <a href={`tel:${phoneNumber}`}>{phoneNumber}</a>;
}
```
:::
:::Producers
When your code produces a `Phone`, for a context or a function return, assign a number using
the accepted characters:

```ts
import type { Phone } from '@wix/editor-react-types';

const phoneNumber: Phone = '+1 (555) 123-4567';
```
:::
::::

## Manifest

In your manifest, declare the field with the `phone` dataType:

```json
{ "dataType": "phone" }
```

### Declaration

Declare a `phone` field in one of these ways, depending on where the value comes from:

::::tabs
:::Data-property
Declare it as a data property when the Wix user should enter the number in a panel. It takes
`dataType`, `displayName`, and an optional `defaultValue`:

```json
{
  "phoneNumber": {
    "dataType": "phone",
    "displayName": "Business Phone",
    "defaultValue": "+1 (555) 123-4567"
  }
}
```
:::
:::Context-item
Declare it as a context item when your component supplies the number to descendant components. It
takes just `dataType` and `displayName`:

```json
{
  "phoneNumber": {
    "dataType": "phone",
    "displayName": "Business Phone"
  }
}
```
:::
:::Function-parameter-and-return
Declare it on a function when the function accepts or returns a phone number. It takes `dataType`
and an optional `displayName`, and a parameter may also set `optional`:

```json
{
  "parameters": [
    {
      "dataType": "phone",
      "displayName": "Business Phone"
    }
  ],
  "returns": {
    "dataType": "phone"
  }
}
```
:::
::::