# HasInputMode

> Provides an immutable API for the inputmode attribute.

[API reference](/docs/api/index.md) › [HTML Attribute](/docs/extensions/html-attribute/reference/index.md) › [Global](/docs/extensions/html-attribute/reference/global/index.md) › HasInputMode

| trait | `UIAwesome\Html\Attribute\Global\HasInputMode` |
| --- | --- |
| Source | [`src/Global/HasInputMode.php`](https://github.com/ui-awesome/html-attribute/blob/main/src/Global/HasInputMode.php#L19) |

Used by 1 type:

- [`UIAwesome\Html\Form\InputPassword`](/docs/extensions/html/reference/form/inputpassword/index.md)

Provides an immutable API for the `inputmode` attribute.

See also: <https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode>.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`inputMode()`](#method-inputMode) | Sets the `inputmode` attribute. | `HasInputMode` |

## Method details

### inputMode() <span id="method-inputMode"></span>

```php
public function inputMode(string|UnitEnum|null $value): static
```

Sets the `inputmode` attribute.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string\|`[`UnitEnum`](https://www.php.net/manual/en/class.unitenum.php)`\|null` | Input mode value ('decimal', 'email', 'none', 'numeric', 'search', 'tel', 'text', 'url', or `null` to remove the attribute). |

**Returns**

`static`: New instance with the updated `inputmode` attribute.

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If the provided value is not valid.