# HasImageSrcSet

> Provides an immutable API for the imagesrcset attribute.

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

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

Used by 1 type:

- [`UIAwesome\Html\Metadata\Link`](/docs/extensions/html/reference/metadata/link/index.md)

Provides an immutable API for the `imagesrcset` attribute.

See also: <https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link#imagesrcset>.

## Methods

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

## Method details

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

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

Sets the `imagesrcset` attribute.

Defines the image srcset descriptor list for preload links.

**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` | Image srcset descriptor list, or `null` to remove the attribute. |

**Returns**

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