# HasPopover

> Provides an immutable API for the popover 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) › HasPopover

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

Provides an immutable API for the `popover` attribute.

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

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`popover()`](#method-popover) | Sets the `popover` attribute. | `HasPopover` |

## Method details

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

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

Sets the `popover` attribute.

**Parameters**

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

**Returns**

`static`: New instance with the updated `popover` attribute. [`Popover`](/docs/extensions/html-attribute/reference/values/popover/index.md) for predefined enum values.

**Throws**

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