# PlaceholderInterface

> Defines the contract for form controls that expose the placeholder attribute.

[API reference](/docs/api/index.md) › [HTML Contracts](/docs/extensions/html-contracts/reference/index.md) › [Form](/docs/extensions/html-contracts/reference/form/index.md) › PlaceholderInterface

| interface | `UIAwesome\Html\Contracts\Form\PlaceholderInterface` |
| --- | --- |
| Source | [`src/Form/PlaceholderInterface.php`](https://github.com/ui-awesome/html-contracts/blob/main/src/Form/PlaceholderInterface.php#L15) |

Implemented by 8 types:

- [`UIAwesome\Html\Form\InputEmail`](/docs/extensions/html/reference/form/inputemail/index.md)
- [`UIAwesome\Html\Form\InputNumber`](/docs/extensions/html/reference/form/inputnumber/index.md)
- [`UIAwesome\Html\Form\InputPassword`](/docs/extensions/html/reference/form/inputpassword/index.md)
- [`UIAwesome\Html\Form\InputSearch`](/docs/extensions/html/reference/form/inputsearch/index.md)
- [`UIAwesome\Html\Form\InputTel`](/docs/extensions/html/reference/form/inputtel/index.md)
- [`UIAwesome\Html\Form\InputText`](/docs/extensions/html/reference/form/inputtext/index.md)
- [`UIAwesome\Html\Form\InputUrl`](/docs/extensions/html/reference/form/inputurl/index.md)
- [`UIAwesome\Html\Form\TextArea`](/docs/extensions/html/reference/form/textarea/index.md)

Defines the contract for form controls that expose the `placeholder` attribute.

Applies to controls that display a short hint describing the expected value before the user enters data.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`placeholder()`](#method-placeholder) abstract | Sets the `placeholder` attribute. | `PlaceholderInterface` |

## Method details

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

```php
abstract public function placeholder(string|Stringable|UnitEnum|null $value): static
```

Sets the `placeholder` attribute.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string\|`[`Stringable`](https://www.php.net/manual/en/class.stringable.php)`\|`[`UnitEnum`](https://www.php.net/manual/en/class.unitenum.php)`\|null` | Expected-value hint, or `null` to remove the attribute. |

**Returns**

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