Source
API reference › HTML › Embedded › Source
Renders the HTML <source> element for media and responsive image sources.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/source (BaseVoid for the base implementation.).
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$attributes protected | mixed[] | HTML attributes array used by the implementing class. Default: []. | UIAwesome\ |
Methods
Section titled “Methods”Method details
Section titled “Method details”height()
Section titled “height() ”public function height(int|string|Stringable|UnitEnum|null $value): staticSets the height attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | int|Stringable|UnitEnum| | Height value in pixels or CSS units, or null to remove the attribute. |
Returns
static: New instance with the updated height attribute.
src()
Section titled “src() ”public function src(string|Stringable|UnitEnum|null $value): staticSets the src attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Image source URL or path, or null to remove the attribute. |
Returns
static: New instance with the updated src attribute.
srcset()
Section titled “srcset() ”public function srcset(string|Stringable|UnitEnum|null $value): staticSets the srcset attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Comma-separated image URLs with size descriptors, or null to remove the attribute. |
Returns
static: New instance with the updated srcset attribute.
type()
Section titled “type() ”public function type(string|UnitEnum|null $value): staticSets the type attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|UnitEnum| | Resource MIME type, optionally including a codecs parameter, or null to remove the attribute. |
Returns
static: New instance with the updated type attribute.
width()
Section titled “width() ”public function width(int|string|Stringable|UnitEnum|null $value): staticSets the width attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | int|Stringable|UnitEnum| | Width value in pixels or CSS units, or null to remove the attribute. |
Returns
static: New instance with the updated width attribute.
getTag()
Section titled “getTag() ”protected function getTag(): UIAwesome\Html\Interop\VoidsReturns the tag enumeration for the <source> element.