# ValueInterface

> Defines the contract for elements that expose a single-valued value attribute.

[API reference](/docs/api/index.md) › [HTML Contracts](/docs/extensions/html-contracts/reference/index.md) › [Attribute](/docs/extensions/html-contracts/reference/attribute/index.md) › ValueInterface

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

Implemented by 21 types:

- [`UIAwesome\Html\Form\AbstractInputDateTime`](/docs/extensions/html/reference/form/abstractinputdatetime/index.md)
- [`UIAwesome\Html\Form\Button`](/docs/extensions/html/reference/form/button/index.md)
- [`UIAwesome\Html\Form\InputCheckbox`](/docs/extensions/html/reference/form/inputcheckbox/index.md)
- [`UIAwesome\Html\Form\InputColor`](/docs/extensions/html/reference/form/inputcolor/index.md)
- [`UIAwesome\Html\Form\InputEmail`](/docs/extensions/html/reference/form/inputemail/index.md)
- [`UIAwesome\Html\Form\InputHidden`](/docs/extensions/html/reference/form/inputhidden/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\InputRadio`](/docs/extensions/html/reference/form/inputradio/index.md)
- [`UIAwesome\Html\Form\InputRange`](/docs/extensions/html/reference/form/inputrange/index.md)
- [`UIAwesome\Html\Form\InputReset`](/docs/extensions/html/reference/form/inputreset/index.md)
- [`UIAwesome\Html\Form\InputSearch`](/docs/extensions/html/reference/form/inputsearch/index.md)
- [`UIAwesome\Html\Form\InputSubmit`](/docs/extensions/html/reference/form/inputsubmit/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\Meter`](/docs/extensions/html/reference/form/meter/index.md)
- [`UIAwesome\Html\Form\Option`](/docs/extensions/html/reference/form/option/index.md)
- [`UIAwesome\Html\Form\Progress`](/docs/extensions/html/reference/form/progress/index.md)
- [`UIAwesome\Html\Form\Select`](/docs/extensions/html/reference/form/select/index.md)
- [`UIAwesome\Html\List\Li`](/docs/extensions/html/reference/list/li/index.md)

Defines the contract for elements that expose a single-valued `value` attribute.

Applies to scalar-valued controls such as text inputs, hidden inputs, buttons, and options.

## Methods

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

## Method details

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

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

Sets the `value` attribute.

**Parameters**

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

**Returns**

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