> 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: Hostname

## Article: Hostname

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

## Article Content:

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

# Hostname

A hostname according to IANA standards. Use it for a field that names a host without a scheme or
path, such as the server a component talks to. For example, `'www.example.com'`.

## Component

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

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

At runtime it's a plain string:

```ts
type Hostname = string
```

### Usage

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

::::tabs
:::Consumers
In a component that receives a `Hostname`, use it to build a request address:

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

function Status({ host }: { host?: Hostname }) {
  return <span>Connected to {host}</span>;
}
```
:::
:::Producers
When your code produces a `Hostname`, for a context or a function return, assign a valid hostname:

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

const host: Hostname = 'www.example.com';
```
:::
::::

## Manifest

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

```json
{ "dataType": "hostname" }
```

### Declaration

Declare a `hostname` 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 hostname in a panel. It takes
`dataType`, `displayName`, and an optional `defaultValue`:

```json
{
  "host": {
    "dataType": "hostname",
    "displayName": "Server Hostname",
    "defaultValue": "www.example.com"
  }
}
```
:::
:::Context-item
Declare it as a context item when your component supplies the hostname to descendant components. It
takes just `dataType` and `displayName`:

```json
{
  "host": {
    "dataType": "hostname",
    "displayName": "Server Hostname"
  }
}
```
:::
:::Function-parameter-and-return
Declare it on a function when the function accepts or returns a hostname. It takes `dataType` and an
optional `displayName`, and a parameter may also set `optional`:

```json
{
  "parameters": [
    {
      "dataType": "hostname",
      "displayName": "Server Hostname"
    }
  ],
  "returns": {
    "dataType": "hostname"
  }
}
```
:::
::::