# SiIp4InputDirective documentation

**Kind:** directive

**Selector:** `input[siIpV4]`

**Exported as:** `siIpV4`

```
import { SiIp4InputDirective } from '@siemens/element-ng/ip-input';
```

Directive for IPv4 address input fields.

Usage:

```ts
import { SiFormItemComponent } from '@siemens/element-ng/form';
import { SiIp4InputDirective } from '@siemens/element-ng/ip-input';

@Component({
  template: `
    <si-form-item label="IPv4 address">
      <input type="text" class="form-control" siIpV4 />
    </si-form-item>
  `,
  imports: [SiFormItemComponent, SiIp4InputDirective, ...]
})
```

```
directive SiIp4InputDirective extends SiIpInputDirective implements ControlValueAccessor, Validator
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [cidr](<https://github.com/siemens/element/blob/main/projects/element-ng/ip-input/si-ip-input.directive.ts#L67-L67>) (inherited) | `boolean` | `false` | Enable CIDR (Classless Inter-Domain Routing) notation.<br><br>Inherited from `SiIpInputDirective` |
| [disabled](<https://github.com/siemens/element/blob/main/projects/element-ng/ip-input/si-ip-input.directive.ts#L74-L74>) (inherited) | `boolean` | `false` | Whether the ip address input is disabled.<br><br>Inherited from `SiIpInputDirective` |
| [id](<https://github.com/siemens/element/blob/main/projects/element-ng/ip-input/si-ip-input.directive.ts#L61-L61>) (inherited) | `string` | `` `si-ip-input-${SiIpInputDirective.idCounter++}` `` | Inherited from `SiIpInputDirective` |

#### Attributes and Methods

##### registerOnChange

[Source for registerOnChange](<https://github.com/siemens/element/blob/main/projects/element-ng/ip-input/si-ip-input.directive.ts#L82-L84>)

**Modifiers:** inherited

Inherited from `SiIpInputDirective`

Implements [ControlValueAccessor](<https://angular.dev/api/forms/ControlValueAccessor>)

```
registerOnChange(fn: any): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [fn](<https://github.com/siemens/element/blob/main/projects/element-ng/ip-input/si-ip-input.directive.ts#L82-L82>) | `any` |  | The callback function to register |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### registerOnTouched

[Source for registerOnTouched](<https://github.com/siemens/element/blob/main/projects/element-ng/ip-input/si-ip-input.directive.ts#L86-L88>)

**Modifiers:** inherited

Inherited from `SiIpInputDirective`

Implements [ControlValueAccessor](<https://angular.dev/api/forms/ControlValueAccessor>)

```
registerOnTouched(fn: () => void): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [fn](<https://github.com/siemens/element/blob/main/projects/element-ng/ip-input/si-ip-input.directive.ts#L86-L86>) | `() => void` |  | The callback function to register |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### setDisabledState

[Source for setDisabledState](<https://github.com/siemens/element/blob/main/projects/element-ng/ip-input/si-ip-input.directive.ts#L90-L92>)

**Modifiers:** inherited

Inherited from `SiIpInputDirective`

Implements [ControlValueAccessor](<https://angular.dev/api/forms/ControlValueAccessor>)

```
setDisabledState(isDisabled: boolean): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [isDisabled](<https://github.com/siemens/element/blob/main/projects/element-ng/ip-input/si-ip-input.directive.ts#L90-L90>) | `boolean` |  | The disabled status to set on the element |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### writeValue

[Source for writeValue](<https://github.com/siemens/element/blob/main/projects/element-ng/ip-input/si-ip-input.directive.ts#L94-L97>)

**Modifiers:** inherited

Inherited from `SiIpInputDirective`

Implements [ControlValueAccessor](<https://angular.dev/api/forms/ControlValueAccessor>)

```
writeValue(value?: string | null): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [value](<https://github.com/siemens/element/blob/main/projects/element-ng/ip-input/si-ip-input.directive.ts#L94-L94>) (optional) | `string \| null` |  | The new value for the element |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)
