# HasSizes

> Provides an immutable API for the sizes attribute.

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

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

Used by 3 types:

- [`UIAwesome\Html\Embedded\Img`](/docs/extensions/html/reference/embedded/img/index.md)
- [`UIAwesome\Html\Embedded\Source`](/docs/extensions/html/reference/embedded/source/index.md)
- [`UIAwesome\Html\Metadata\Link`](/docs/extensions/html/reference/metadata/link/index.md)

Provides an immutable API for the `sizes` attribute.

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

## Methods

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

## Method details

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

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

Sets the `sizes` attribute.

Defines the icon size descriptors for the linked resource.

**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` | Icon size list or 'any' token, or `null` to remove the attribute. |

**Returns**

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