# Text

> Represents the SVG <text> (text) element for rendering text content in SVG graphics.

[API reference](/docs/api/index.md) › [HTML SVG](/docs/extensions/html-svg/reference/index.md) › Text

| final class | `UIAwesome\Html\Svg\Text` |
| --- | --- |
| Extends | [`UIAwesome\Html\Core\Element\BaseBlock`](/docs/extensions/html-core/reference/element/baseblock/index.md) » [`UIAwesome\Html\Core\Base\BaseTag`](/docs/extensions/html-core/reference/base/basetag/index.md) |
| Implements | [`UIAwesome\Html\Contracts\Attribute\AttributesInterface`](/docs/extensions/html-contracts/reference/attribute/attributesinterface/index.md), [`UIAwesome\Html\Contracts\Element\BlockInterface`](/docs/extensions/html-contracts/reference/element/blockinterface/index.md), [`UIAwesome\Html\Contracts\Element\ClearableContentInterface`](/docs/extensions/html-contracts/reference/element/clearablecontentinterface/index.md), [`UIAwesome\Html\Contracts\RenderableInterface`](/docs/extensions/html-contracts/reference/renderableinterface/index.md) |
| Uses traits | [`UIAwesome\Html\Attribute\Global\CanBeAutofocus`](/docs/extensions/html-attribute/reference/global/canbeautofocus/index.md), [`UIAwesome\Html\Attribute\Global\CanBeHidden`](/docs/extensions/html-attribute/reference/global/canbehidden/index.md), [`UIAwesome\Html\Attribute\Global\HasAccesskey`](/docs/extensions/html-attribute/reference/global/hasaccesskey/index.md), [`UIAwesome\Html\Attribute\Global\HasAria`](/docs/extensions/html-attribute/reference/global/hasaria/index.md), [`UIAwesome\Html\Mixin\HasAttributes`](/docs/extensions/html-mixin/reference/hasattributes/index.md), [`UIAwesome\Html\Attribute\Global\HasClass`](/docs/extensions/html-attribute/reference/global/hasclass/index.md), [`UIAwesome\Html\Mixin\HasContent`](/docs/extensions/html-mixin/reference/hascontent/index.md), [`UIAwesome\Html\Attribute\Global\HasContentEditable`](/docs/extensions/html-attribute/reference/global/hascontenteditable/index.md), [`UIAwesome\Html\Attribute\Global\HasData`](/docs/extensions/html-attribute/reference/global/hasdata/index.md), [`UIAwesome\Html\Attribute\Global\HasDir`](/docs/extensions/html-attribute/reference/global/hasdir/index.md), [`UIAwesome\Html\Attribute\Global\HasDraggable`](/docs/extensions/html-attribute/reference/global/hasdraggable/index.md), [`UIAwesome\Html\Attribute\Global\HasEvents`](/docs/extensions/html-attribute/reference/global/hasevents/index.md), [`UIAwesome\Html\Attribute\Global\HasId`](/docs/extensions/html-attribute/reference/global/hasid/index.md), [`UIAwesome\Html\Attribute\Global\HasLang`](/docs/extensions/html-attribute/reference/global/haslang/index.md), [`UIAwesome\Html\Attribute\Global\HasMicroData`](/docs/extensions/html-attribute/reference/global/hasmicrodata/index.md), [`UIAwesome\Html\Attribute\Global\HasRole`](/docs/extensions/html-attribute/reference/global/hasrole/index.md), [`UIAwesome\Html\Attribute\Global\HasSpellcheck`](/docs/extensions/html-attribute/reference/global/hasspellcheck/index.md), [`UIAwesome\Html\Attribute\Global\HasStyle`](/docs/extensions/html-attribute/reference/global/hasstyle/index.md), [`UIAwesome\Html\Attribute\Global\HasTabindex`](/docs/extensions/html-attribute/reference/global/hastabindex/index.md), [`UIAwesome\Html\Attribute\Global\HasTitle`](/docs/extensions/html-attribute/reference/global/hastitle/index.md), [`UIAwesome\Html\Attribute\Global\HasTranslate`](/docs/extensions/html-attribute/reference/global/hastranslate/index.md), [`UIAwesome\Html\Core\Event\HasAfterRun`](/docs/extensions/html-core/reference/event/hasafterrun/index.md), [`UIAwesome\Html\Core\Event\HasBeforeRun`](/docs/extensions/html-core/reference/event/hasbeforerun/index.md) |
| Source | [`src/Text.php`](https://github.com/ui-awesome/html-svg/blob/main/src/Text.php#L51) |

Represents the SVG `<text>` (text) element for rendering text content in SVG graphics.

Provides a concrete `<text>` element implementation that returns [`SvgBlock::TEXT`](/docs/extensions/html-svg/reference/tag/svgblock/index.md#case-TEXT) and provides text layout,
typography, paint, and transform attribute methods.

The `<text>` element defines text content with positioning, layout, and typography attributes.

Usage example:
```php
use UIAwesome\Html\Svg\Text;

echo Text::tag()
    ->x(12)
    ->y(24)
    ->fontSize(16)
    ->fill('currentColor')
    ->content('Hello SVG')
    ->render();
```

See also: <https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text> ([`BaseBlock`](/docs/extensions/html-core/reference/element/baseblock/index.md) for the base block-level implementation.).

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-attributes"></span>[`$attributes`](/docs/extensions/html-mixin/reference/hasattributes/index.md#property-attributes) protected | `mixed[]` | HTML attributes array used by the implementing class. Default: `[]`. | [`UIAwesome\Html\Mixin\HasAttributes`](/docs/extensions/html-mixin/reference/hasattributes/index.md) |
| <span id="property-content"></span>[`$content`](/docs/extensions/html-mixin/reference/hascontent/index.md#property-content) protected | `string` | Content string assigned to the element. Default: `''`. | [`UIAwesome\Html\Mixin\HasContent`](/docs/extensions/html-mixin/reference/hascontent/index.md) |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| <span id="method-__construct"></span>[`__construct()`](/docs/extensions/html-core/reference/base/basetag/index.md#method-__construct) final | Initializes a new tag instance. | [`UIAwesome\Html\Core\Base\BaseTag`](/docs/extensions/html-core/reference/base/basetag/index.md) |
| <span id="method-__toString"></span>[`__toString()`](/docs/extensions/html-core/reference/base/basetag/index.md#method-__toString) | Returns the rendered tag string. | [`UIAwesome\Html\Core\Base\BaseTag`](/docs/extensions/html-core/reference/base/basetag/index.md) |
| <span id="method-accesskey"></span>[`accesskey()`](/docs/extensions/html-attribute/reference/global/hasaccesskey/index.md#method-accesskey) | Sets the `accesskey` attribute. | [`UIAwesome\Html\Attribute\Global\HasAccesskey`](/docs/extensions/html-attribute/reference/global/hasaccesskey/index.md) |
| <span id="method-addAriaAttribute"></span>[`addAriaAttribute()`](/docs/extensions/html-attribute/reference/global/hasaria/index.md#method-addAriaAttribute) | Sets an `aria-*` attribute. | [`UIAwesome\Html\Attribute\Global\HasAria`](/docs/extensions/html-attribute/reference/global/hasaria/index.md) |
| <span id="method-addAttribute"></span>[`addAttribute()`](/docs/extensions/html-mixin/reference/hasattributes/index.md#method-addAttribute) | Adds or updates a single HTML attribute for the element. | [`UIAwesome\Html\Mixin\HasAttributes`](/docs/extensions/html-mixin/reference/hasattributes/index.md) |
| <span id="method-addDataAttribute"></span>[`addDataAttribute()`](/docs/extensions/html-attribute/reference/global/hasdata/index.md#method-addDataAttribute) | Sets a `data-*` attribute. | [`UIAwesome\Html\Attribute\Global\HasData`](/docs/extensions/html-attribute/reference/global/hasdata/index.md) |
| <span id="method-addEvent"></span>[`addEvent()`](/docs/extensions/html-attribute/reference/global/hasevents/index.md#method-addEvent) | Sets an `on*` event attribute. | [`UIAwesome\Html\Attribute\Global\HasEvents`](/docs/extensions/html-attribute/reference/global/hasevents/index.md) |
| <span id="method-ariaAttributes"></span>[`ariaAttributes()`](/docs/extensions/html-attribute/reference/global/hasaria/index.md#method-ariaAttributes) | Sets multiple `aria-*` attributes. | [`UIAwesome\Html\Attribute\Global\HasAria`](/docs/extensions/html-attribute/reference/global/hasaria/index.md) |
| <span id="method-attributes"></span>[`attributes()`](/docs/extensions/html-mixin/reference/hasattributes/index.md#method-attributes) | Adds or updates multiple HTML attributes for the element. | [`UIAwesome\Html\Mixin\HasAttributes`](/docs/extensions/html-mixin/reference/hasattributes/index.md) |
| <span id="method-autofocus"></span>[`autofocus()`](/docs/extensions/html-attribute/reference/global/canbeautofocus/index.md#method-autofocus) | Sets the `autofocus` attribute. | [`UIAwesome\Html\Attribute\Global\CanBeAutofocus`](/docs/extensions/html-attribute/reference/global/canbeautofocus/index.md) |
| <span id="method-begin"></span>[`begin()`](/docs/extensions/html-core/reference/element/baseblock/index.md#method-begin) final | Starts begin/end rendering for this instance. | [`UIAwesome\Html\Core\Element\BaseBlock`](/docs/extensions/html-core/reference/element/baseblock/index.md) |
| <span id="method-class"></span>[`class()`](/docs/extensions/html-attribute/reference/global/hasclass/index.md#method-class) | Sets the `class` attribute. | [`UIAwesome\Html\Attribute\Global\HasClass`](/docs/extensions/html-attribute/reference/global/hasclass/index.md) |
| <span id="method-clearContent"></span>[`clearContent()`](/docs/extensions/html-mixin/reference/hascontent/index.md#method-clearContent) | Clears encoded and raw content without changing other component state. | [`UIAwesome\Html\Mixin\HasContent`](/docs/extensions/html-mixin/reference/hascontent/index.md) |
| <span id="method-config"></span>[`config()`](/docs/extensions/html-core/reference/base/basetag/index.md#method-config) | Applies application-scoped config recipes to this tag. | [`UIAwesome\Html\Core\Base\BaseTag`](/docs/extensions/html-core/reference/base/basetag/index.md) |
| <span id="method-content"></span>[`content()`](/docs/extensions/html-mixin/reference/hascontent/index.md#method-content) | Appends encoded content. | [`UIAwesome\Html\Mixin\HasContent`](/docs/extensions/html-mixin/reference/hascontent/index.md) |
| <span id="method-contentEditable"></span>[`contentEditable()`](/docs/extensions/html-attribute/reference/global/hascontenteditable/index.md#method-contentEditable) | Sets the `contenteditable` attribute. | [`UIAwesome\Html\Attribute\Global\HasContentEditable`](/docs/extensions/html-attribute/reference/global/hascontenteditable/index.md) |
| <span id="method-dataAttributes"></span>[`dataAttributes()`](/docs/extensions/html-attribute/reference/global/hasdata/index.md#method-dataAttributes) | Sets multiple `data-*` attributes. | [`UIAwesome\Html\Attribute\Global\HasData`](/docs/extensions/html-attribute/reference/global/hasdata/index.md) |
| <span id="method-dir"></span>[`dir()`](/docs/extensions/html-attribute/reference/global/hasdir/index.md#method-dir) | Sets the `dir` attribute. | [`UIAwesome\Html\Attribute\Global\HasDir`](/docs/extensions/html-attribute/reference/global/hasdir/index.md) |
| [`dominantBaseline()`](#method-dominantBaseline) | Sets SVG `dominant-baseline` attribute for the element. | `Text` |
| <span id="method-draggable"></span>[`draggable()`](/docs/extensions/html-attribute/reference/global/hasdraggable/index.md#method-draggable) | Sets the `draggable` attribute. | [`UIAwesome\Html\Attribute\Global\HasDraggable`](/docs/extensions/html-attribute/reference/global/hasdraggable/index.md) |
| [`dx()`](#method-dx) | Sets the SVG `dx` attribute for the element. | `Text` |
| [`dy()`](#method-dy) | Sets the SVG `dy` attribute for the element. | `Text` |
| <span id="method-end"></span>[`end()`](/docs/extensions/html-core/reference/element/baseblock/index.md#method-end) static final | Ends the most recent begin/end rendering block for the current class. | [`UIAwesome\Html\Core\Element\BaseBlock`](/docs/extensions/html-core/reference/element/baseblock/index.md) |
| <span id="method-events"></span>[`events()`](/docs/extensions/html-attribute/reference/global/hasevents/index.md#method-events) | Sets multiple `on*` event attributes. | [`UIAwesome\Html\Attribute\Global\HasEvents`](/docs/extensions/html-attribute/reference/global/hasevents/index.md) |
| [`fill()`](#method-fill) | Sets the SVG `fill` attribute for the element. | `Text` |
| [`fillOpacity()`](#method-fillOpacity) | Sets SVG `fill-opacity` attribute for the element. | `Text` |
| [`fillRule()`](#method-fillRule) | Sets SVG `fill-rule` attribute for the element. | `Text` |
| [`fontFamily()`](#method-fontFamily) | Sets the SVG `font-family` attribute for the element. | `Text` |
| [`fontSize()`](#method-fontSize) | Sets the SVG `font-size` attribute for the element. | `Text` |
| [`fontStyle()`](#method-fontStyle) | Sets SVG `font-style` attribute for the element. | `Text` |
| [`fontWeight()`](#method-fontWeight) | Sets the SVG `font-weight` attribute for the element. | `Text` |
| <span id="method-getAttribute"></span>[`getAttribute()`](/docs/extensions/html-mixin/reference/hasattributes/index.md#method-getAttribute) | Returns the value of a single HTML attribute. | [`UIAwesome\Html\Mixin\HasAttributes`](/docs/extensions/html-mixin/reference/hasattributes/index.md) |
| <span id="method-getAttributes"></span>[`getAttributes()`](/docs/extensions/html-mixin/reference/hasattributes/index.md#method-getAttributes) | Returns the `array` of HTML attributes for the element. | [`UIAwesome\Html\Mixin\HasAttributes`](/docs/extensions/html-mixin/reference/hasattributes/index.md) |
| <span id="method-getContent"></span>[`getContent()`](/docs/extensions/html-mixin/reference/hascontent/index.md#method-getContent) | Returns the content assigned to the element. | [`UIAwesome\Html\Mixin\HasContent`](/docs/extensions/html-mixin/reference/hascontent/index.md) |
| <span id="method-hidden"></span>[`hidden()`](/docs/extensions/html-attribute/reference/global/canbehidden/index.md#method-hidden) | Sets the `hidden` attribute. | [`UIAwesome\Html\Attribute\Global\CanBeHidden`](/docs/extensions/html-attribute/reference/global/canbehidden/index.md) |
| <span id="method-html"></span>[`html()`](/docs/extensions/html-mixin/reference/hascontent/index.md#method-html) | Appends trusted raw HTML content without encoding or sanitizing it. | [`UIAwesome\Html\Mixin\HasContent`](/docs/extensions/html-mixin/reference/hascontent/index.md) |
| <span id="method-id"></span>[`id()`](/docs/extensions/html-attribute/reference/global/hasid/index.md#method-id) | Sets the `id` attribute. | [`UIAwesome\Html\Attribute\Global\HasId`](/docs/extensions/html-attribute/reference/global/hasid/index.md) |
| <span id="method-itemId"></span>[`itemId()`](/docs/extensions/html-attribute/reference/global/hasmicrodata/index.md#method-itemId) | Sets the `itemid` attribute. | [`UIAwesome\Html\Attribute\Global\HasMicroData`](/docs/extensions/html-attribute/reference/global/hasmicrodata/index.md) |
| <span id="method-itemProp"></span>[`itemProp()`](/docs/extensions/html-attribute/reference/global/hasmicrodata/index.md#method-itemProp) | Sets the `itemprop` attribute. | [`UIAwesome\Html\Attribute\Global\HasMicroData`](/docs/extensions/html-attribute/reference/global/hasmicrodata/index.md) |
| <span id="method-itemRef"></span>[`itemRef()`](/docs/extensions/html-attribute/reference/global/hasmicrodata/index.md#method-itemRef) | Sets the `itemref` attribute. | [`UIAwesome\Html\Attribute\Global\HasMicroData`](/docs/extensions/html-attribute/reference/global/hasmicrodata/index.md) |
| <span id="method-itemScope"></span>[`itemScope()`](/docs/extensions/html-attribute/reference/global/hasmicrodata/index.md#method-itemScope) | Sets the `itemscope` attribute. | [`UIAwesome\Html\Attribute\Global\HasMicroData`](/docs/extensions/html-attribute/reference/global/hasmicrodata/index.md) |
| <span id="method-itemType"></span>[`itemType()`](/docs/extensions/html-attribute/reference/global/hasmicrodata/index.md#method-itemType) | Sets the `itemtype` attribute. | [`UIAwesome\Html\Attribute\Global\HasMicroData`](/docs/extensions/html-attribute/reference/global/hasmicrodata/index.md) |
| <span id="method-lang"></span>[`lang()`](/docs/extensions/html-attribute/reference/global/haslang/index.md#method-lang) | Sets the `lang` attribute. | [`UIAwesome\Html\Attribute\Global\HasLang`](/docs/extensions/html-attribute/reference/global/haslang/index.md) |
| [`lengthAdjust()`](#method-lengthAdjust) | Sets SVG `lengthAdjust` attribute for the element. | `Text` |
| [`letterSpacing()`](#method-letterSpacing) | Sets the SVG `letter-spacing` attribute for the element. | `Text` |
| [`opacity()`](#method-opacity) | Sets the SVG `opacity` attribute for the element. | `Text` |
| <span id="method-removeAriaAttribute"></span>[`removeAriaAttribute()`](/docs/extensions/html-attribute/reference/global/hasaria/index.md#method-removeAriaAttribute) | Removes an `aria-*` attribute. | [`UIAwesome\Html\Attribute\Global\HasAria`](/docs/extensions/html-attribute/reference/global/hasaria/index.md) |
| <span id="method-removeAttribute"></span>[`removeAttribute()`](/docs/extensions/html-mixin/reference/hasattributes/index.md#method-removeAttribute) | Removes a specific HTML attribute from the element. | [`UIAwesome\Html\Mixin\HasAttributes`](/docs/extensions/html-mixin/reference/hasattributes/index.md) |
| <span id="method-removeDataAttribute"></span>[`removeDataAttribute()`](/docs/extensions/html-attribute/reference/global/hasdata/index.md#method-removeDataAttribute) | Removes a `data-*` attribute. | [`UIAwesome\Html\Attribute\Global\HasData`](/docs/extensions/html-attribute/reference/global/hasdata/index.md) |
| <span id="method-removeEvent"></span>[`removeEvent()`](/docs/extensions/html-attribute/reference/global/hasevents/index.md#method-removeEvent) | Removes an `on*` event attribute. | [`UIAwesome\Html\Attribute\Global\HasEvents`](/docs/extensions/html-attribute/reference/global/hasevents/index.md) |
| <span id="method-render"></span>[`render()`](/docs/extensions/html-core/reference/base/basetag/index.md#method-render) final | Renders the tag with lifecycle hooks. | [`UIAwesome\Html\Core\Base\BaseTag`](/docs/extensions/html-core/reference/base/basetag/index.md) |
| <span id="method-replaceAttributes"></span>[`replaceAttributes()`](/docs/extensions/html-mixin/reference/hasattributes/index.md#method-replaceAttributes) | Replaces all HTML attributes for the element. | [`UIAwesome\Html\Mixin\HasAttributes`](/docs/extensions/html-mixin/reference/hasattributes/index.md) |
| <span id="method-role"></span>[`role()`](/docs/extensions/html-attribute/reference/global/hasrole/index.md#method-role) | Sets the `role` attribute. | [`UIAwesome\Html\Attribute\Global\HasRole`](/docs/extensions/html-attribute/reference/global/hasrole/index.md) |
| [`rotate()`](#method-rotate) | Sets the SVG `rotate` attribute for the element. | `Text` |
| <span id="method-spellcheck"></span>[`spellcheck()`](/docs/extensions/html-attribute/reference/global/hasspellcheck/index.md#method-spellcheck) | Sets the `spellcheck` attribute. | [`UIAwesome\Html\Attribute\Global\HasSpellcheck`](/docs/extensions/html-attribute/reference/global/hasspellcheck/index.md) |
| [`stroke()`](#method-stroke) | Sets the SVG `stroke` attribute for the element. | `Text` |
| [`strokeDashArray()`](#method-strokeDashArray) | Sets the SVG `stroke-dasharray` attribute for the element. | `Text` |
| [`strokeLineCap()`](#method-strokeLineCap) | Sets the SVG `stroke-linecap` attribute for the element. | `Text` |
| [`strokeLineJoin()`](#method-strokeLineJoin) | Sets the SVG `stroke-linejoin` attribute for the element. | `Text` |
| [`strokeMiterlimit()`](#method-strokeMiterlimit) | Sets SVG `stroke-miterlimit` attribute for the element. | `Text` |
| [`strokeOpacity()`](#method-strokeOpacity) | Sets SVG `stroke-opacity` attribute for the element. | `Text` |
| [`strokeWidth()`](#method-strokeWidth) | Sets the SVG `stroke-width` attribute for the element. | `Text` |
| <span id="method-style"></span>[`style()`](/docs/extensions/html-attribute/reference/global/hasstyle/index.md#method-style) | Sets the `style` attribute. | [`UIAwesome\Html\Attribute\Global\HasStyle`](/docs/extensions/html-attribute/reference/global/hasstyle/index.md) |
| <span id="method-tabIndex"></span>[`tabIndex()`](/docs/extensions/html-attribute/reference/global/hastabindex/index.md#method-tabIndex) | Sets the `tabindex` attribute. | [`UIAwesome\Html\Attribute\Global\HasTabindex`](/docs/extensions/html-attribute/reference/global/hastabindex/index.md) |
| <span id="method-tag"></span>[`tag()`](/docs/extensions/html-core/reference/base/basetag/index.md#method-tag) static | Creates and configures a new tag instance. | [`UIAwesome\Html\Core\Base\BaseTag`](/docs/extensions/html-core/reference/base/basetag/index.md) |
| [`textAnchor()`](#method-textAnchor) | Sets SVG `text-anchor` attribute for the element. | `Text` |
| [`textDecoration()`](#method-textDecoration) | Sets the SVG `text-decoration` shorthand attribute for the text element. | `Text` |
| [`textLength()`](#method-textLength) | Sets the SVG `textLength` attribute for the element. | `Text` |
| [`title()`](#method-title) | Sets the `title` attribute. | `Text` |
| [`transform()`](#method-transform) | Sets the SVG `transform` attribute for the element. | `Text` |
| <span id="method-translate"></span>[`translate()`](/docs/extensions/html-attribute/reference/global/hastranslate/index.md#method-translate) | Sets the `translate` attribute. | [`UIAwesome\Html\Attribute\Global\HasTranslate`](/docs/extensions/html-attribute/reference/global/hastranslate/index.md) |
| [`wordSpacing()`](#method-wordSpacing) | Sets the SVG `word-spacing` attribute for the element. | `Text` |
| [`writingMode()`](#method-writingMode) | Sets SVG `writing-mode` attribute for the element. | `Text` |
| [`x()`](#method-x) | Sets the SVG `x` attribute for the element. | `Text` |
| [`y()`](#method-y) | Sets the SVG `y` attribute for the element. | `Text` |
| <span id="method-afterRun"></span>[`afterRun()`](/docs/extensions/html-core/reference/event/hasafterrun/index.md#method-afterRun) protected | Post-processes rendered output. | [`UIAwesome\Html\Core\Event\HasAfterRun`](/docs/extensions/html-core/reference/event/hasafterrun/index.md) |
| <span id="method-beforeRun"></span>[`beforeRun()`](/docs/extensions/html-core/reference/event/hasbeforerun/index.md#method-beforeRun) protected | Validates state before rendering. | [`UIAwesome\Html\Core\Event\HasBeforeRun`](/docs/extensions/html-core/reference/event/hasbeforerun/index.md) |
| [`getTag()`](#method-getTag) protected | Returns the tag enumeration for the `<text>` element. | `Text` |
| <span id="method-isBeginExecuted"></span>[`isBeginExecuted()`](/docs/extensions/html-core/reference/element/baseblock/index.md#method-isBeginExecuted) protected | Indicates whether this instance has an open or closing operation in the current context. | [`UIAwesome\Html\Core\Element\BaseBlock`](/docs/extensions/html-core/reference/element/baseblock/index.md) |
| <span id="method-loadDefault"></span>[`loadDefault()`](/docs/extensions/html-core/reference/base/basetag/index.md#method-loadDefault) protected | Returns class-level default definitions. | [`UIAwesome\Html\Core\Base\BaseTag`](/docs/extensions/html-core/reference/base/basetag/index.md) |
| <span id="method-run"></span>[`run()`](/docs/extensions/html-core/reference/element/baseblock/index.md#method-run) protected | Renders the block element. | [`UIAwesome\Html\Core\Element\BaseBlock`](/docs/extensions/html-core/reference/element/baseblock/index.md) |
| <span id="method-runBegin"></span>[`runBegin()`](/docs/extensions/html-core/reference/element/baseblock/index.md#method-runBegin) protected | Returns the opening tag for begin/end rendering. | [`UIAwesome\Html\Core\Element\BaseBlock`](/docs/extensions/html-core/reference/element/baseblock/index.md) |

## Method details

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

```php
public function dominantBaseline(UIAwesome\Html\Svg\Values\DominantBaseline|string|null $value): static
```

Sets SVG `dominant-baseline` attribute for the element.

Creates a new instance with the specified dominant baseline value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | [`UIAwesome\Html\Svg\Values\DominantBaseline`](/docs/extensions/html-svg/reference/values/dominantbaseline/index.md)`\|string\|null` | Dominant baseline value to set for the element. Accepts 'auto', 'alphabetic', 'middle', 'central', 'hanging', 'mathematical', 'ideographic', 'text-top', 'text-bottom', [`DominantBaseline`](/docs/extensions/html-svg/reference/values/dominantbaseline/index.md) enum, or `null` to unset. |

**Returns**

`static`: New instance with the updated `dominant-baseline` attribute.

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If the provided value is not a valid [`DominantBaseline`](/docs/extensions/html-svg/reference/values/dominantbaseline/index.md) enum or string.

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

```php
public function dx(float|int|string|null $value): static
```

Sets the SVG `dx` attribute for the element.

Creates a new instance with the specified dx-offset value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `float\|int\|string\|null` | DX offset value (for example, '10', '5 10 15', or `null` to unset). |

**Returns**

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

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

```php
public function dy(float|int|string|null $value): static
```

Sets the SVG `dy` attribute for the element.

Creates a new instance with the specified dy-offset value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `float\|int\|string\|null` | DY offset value (for example, '10', '5 10 15', or `null` to unset). |

**Returns**

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

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

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

Sets the SVG `fill` attribute for the element.

Creates a new instance with the specified fill value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string\|null` | Fill value (for example, 'red', 'url(#gradient1)', or `null` to unset). |

**Returns**

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

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

```php
public function fillOpacity(float|int|string|null $value): static
```

Sets SVG `fill-opacity` attribute for the element.

Creates a new instance with the specified fill opacity value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `float\|int\|string\|null` | Fill opacity value (for example, '0.5' or `null` to unset). |

**Returns**

`static`: New instance with the updated `fill-opacity` attribute.

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If the value is outside the allowed range ('0'-'1') and not `null`.

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

```php
public function fillRule(UIAwesome\Html\Svg\Values\FillRule|string|null $value): static
```

Sets SVG `fill-rule` attribute for the element.

Creates a new instance with the specified fill rule value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | [`UIAwesome\Html\Svg\Values\FillRule`](/docs/extensions/html-svg/reference/values/fillrule/index.md)`\|string\|null` | Fill rule value to set for the element. Accepts 'nonzero', 'evenodd', [`FillRule`](/docs/extensions/html-svg/reference/values/fillrule/index.md) enum, or `null` to unset. |

**Returns**

`static`: New instance with the updated `fill-rule` attribute.

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If the provided value is not a valid [`FillRule`](/docs/extensions/html-svg/reference/values/fillrule/index.md) enum or string.

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

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

Sets the SVG `font-family` attribute for the element.

Creates a new instance with the specified font family value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string\|null` | Font family value (for example, 'Arial', 'Arial, sans-serif', or `null` to unset). |

**Returns**

`static`: New instance with the updated `font-family` attribute.

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

```php
public function fontSize(float|int|string|null $value): static
```

Sets the SVG `font-size` attribute for the element.

Creates a new instance with the specified font size value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `float\|int\|string\|null` | Font size value (for example, '16', '1.2em', '120%', or `null` to unset). |

**Returns**

`static`: New instance with the updated `font-size` attribute.

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

```php
public function fontStyle(UIAwesome\Html\Svg\Values\FontStyle|string|null $value): static
```

Sets SVG `font-style` attribute for the element.

Creates a new instance with the specified font style value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | [`UIAwesome\Html\Svg\Values\FontStyle`](/docs/extensions/html-svg/reference/values/fontstyle/index.md)`\|string\|null` | Font style value to set for the element. Accepts 'normal', 'italic', 'oblique', [`FontStyle`](/docs/extensions/html-svg/reference/values/fontstyle/index.md) enum, or `null` to unset. |

**Returns**

`static`: New instance with the updated `font-style` attribute.

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If the provided value is not a valid [`FontStyle`](/docs/extensions/html-svg/reference/values/fontstyle/index.md) enum or string.

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

```php
public function fontWeight(int|string|null $value): static
```

Sets the SVG `font-weight` attribute for the element.

Creates a new instance with the specified font weight value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `int\|string\|null` | Font weight value (for example, '700', 'bold', or `null` to unset). |

**Returns**

`static`: New instance with the updated `font-weight` attribute.

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

```php
public function lengthAdjust(UIAwesome\Html\Svg\Values\LengthAdjust|string|null $value): static
```

Sets SVG `lengthAdjust` attribute for the element.

Creates a new instance with the specified length adjust value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | [`UIAwesome\Html\Svg\Values\LengthAdjust`](/docs/extensions/html-svg/reference/values/lengthadjust/index.md)`\|string\|null` | Length adjust value (for example, 'spacing', [`LengthAdjust`](/docs/extensions/html-svg/reference/values/lengthadjust/index.md) enum, or `null` to unset). |

**Returns**

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

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If the provided value is not a valid [`LengthAdjust`](/docs/extensions/html-svg/reference/values/lengthadjust/index.md) enum or string.

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

```php
public function letterSpacing(float|int|string|null $value): static
```

Sets the SVG `letter-spacing` attribute for the element.

Creates a new instance with the specified letter spacing value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `float\|int\|string\|null` | Letter spacing value (for example, '2', '0.1em', 'normal', or `null` to unset). |

**Returns**

`static`: New instance with the updated `letter-spacing` attribute.

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

```php
public function opacity(float|int|string|null $value): static
```

Sets the SVG `opacity` attribute for the element.

Creates a new instance with the specified opacity value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `float\|int\|string\|null` | Opacity value (for example, '0.5' or `null` to unset). |

**Returns**

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

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If the value is outside the allowed range ('0'-'1') and not `null`.

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

```php
public function rotate(float|int|string|null $value): static
```

Sets the SVG `rotate` attribute for the element.

Creates a new instance with the specified rotation value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `float\|int\|string\|null` | Rotate value (for example, '45', '10 20 30 40', or `null` to unset). |

**Returns**

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

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

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

Sets the SVG `stroke` attribute for the element.

Creates a new instance with the specified stroke value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string\|null` | Stroke paint value (for example, 'black', 'url(#gradient1)', or `null` to unset). |

**Returns**

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

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

```php
public function strokeDashArray(float|int|string|null $value): static
```

Sets the SVG `stroke-dasharray` attribute for the element.

Creates a new instance with the specified dash array value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `float\|int\|string\|null` | Dash array value (for example, '5.3' or `null` to unset). |

**Returns**

`static`: New instance with the updated `stroke-dasharray` attribute.

**See also**

- <https://www.w3.org/TR/SVG2/painting.html#StrokeDashing> (Usage example: $element->strokeDashArray(5.3); $element->strokeDashArray(4); $element->strokeDashArray(null);)

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

```php
public function strokeLineCap(string|UIAwesome\Html\Svg\Values\StrokeLineCap|null $value): static
```

Sets the SVG `stroke-linecap` attribute for the element.

Creates a new instance with the specified stroke line cap value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string\|`[`UIAwesome\Html\Svg\Values\StrokeLineCap`](/docs/extensions/html-svg/reference/values/strokelinecap/index.md)`\|null` | Stroke line cap style (for example, 'round', [`StrokeLineCap`](/docs/extensions/html-svg/reference/values/strokelinecap/index.md) enum, or `null` to unset). |

**Returns**

`static`: New instance with the updated `stroke-linecap` attribute.

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If the provided value is not a valid [`StrokeLineCap`](/docs/extensions/html-svg/reference/values/strokelinecap/index.md) enum or string.

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

```php
public function strokeLineJoin(string|UIAwesome\Html\Svg\Values\StrokeLineJoin|null $value): static
```

Sets the SVG `stroke-linejoin` attribute for the element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string\|`[`UIAwesome\Html\Svg\Values\StrokeLineJoin`](/docs/extensions/html-svg/reference/values/strokelinejoin/index.md)`\|null` | Stroke line join style (for example, 'miter', [`StrokeLineJoin`](/docs/extensions/html-svg/reference/values/strokelinejoin/index.md) enum, or `null` to unset). |

**Returns**

`static`: New instance with the updated `stroke-linejoin` attribute.

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If the provided value is not a valid [`StrokeLineJoin`](/docs/extensions/html-svg/reference/values/strokelinejoin/index.md) enum or string.

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

```php
public function strokeMiterlimit(float|int|string|null $value): static
```

Sets SVG `stroke-miterlimit` attribute for the element.

Creates a new instance with the specified stroke miter limit value for the rendered element.

The `stroke-miterlimit` attribute controls the limit on the ratio of the miter length to the stroke width. When
the limit is exceeded, the join is converted from a miter to a bevel. The value must be a number '>= 1'.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `float\|int\|string\|null` | Stroke miter limit value (for example, '4' or `null` to unset). |

**Returns**

`static`: New instance with the updated `stroke-miterlimit` attribute.

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If value is not a number '>= 1' or `null`.

**See also**

- <https://www.w3.org/TR/SVG2/painting.html#StrokeMiterlimitProperty> (Usage example: $element->strokeMiterlimit(4); $element->strokeMiterlimit(null);)

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

```php
public function strokeOpacity(float|int|string|null $value): static
```

Sets SVG `stroke-opacity` attribute for the element.

Creates a new instance with the specified stroke opacity value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `float\|int\|string\|null` | Stroke opacity value (for example, '0.8' or `null` to unset). |

**Returns**

`static`: New instance with the updated `stroke-opacity` attribute.

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If the value is outside the allowed range ('0'-'1') and not `null`.

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

```php
public function strokeWidth(int|string|null $value): static
```

Sets the SVG `stroke-width` attribute for the element.

Creates a new instance with the specified stroke width value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `int\|string\|null` | Stroke width value (for example, '2', '1.5em', or `null` to unset). |

**Returns**

`static`: New instance with the updated `stroke-width` attribute.

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

```php
public function textAnchor(string|UIAwesome\Html\Svg\Values\TextAnchor|null $value): static
```

Sets SVG `text-anchor` attribute for the element.

Creates a new instance with the specified text anchor value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string\|`[`UIAwesome\Html\Svg\Values\TextAnchor`](/docs/extensions/html-svg/reference/values/textanchor/index.md)`\|null` | Text anchor value to set for the element. Accepts 'start', 'middle', 'end', [`TextAnchor`](/docs/extensions/html-svg/reference/values/textanchor/index.md) enum, or `null` to unset. |

**Returns**

`static`: New instance with the updated `text-anchor` attribute.

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If the provided value is not a valid [`TextAnchor`](/docs/extensions/html-svg/reference/values/textanchor/index.md) enum or string.

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

```php
public function textDecoration(string|UIAwesome\Html\Svg\Values\TextDecorationLine|UIAwesome\Html\Svg\Values\TextDecorationStyle|null $value): static
```

Sets the SVG `text-decoration` shorthand attribute for the text element.

Creates a new instance with the specified text decoration value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string\|`[`UIAwesome\Html\Svg\Values\TextDecorationLine`](/docs/extensions/html-svg/reference/values/textdecorationline/index.md)`\|`[`UIAwesome\Html\Svg\Values\TextDecorationStyle`](/docs/extensions/html-svg/reference/values/textdecorationstyle/index.md)`\|null` | Text decoration shorthand value (for example, 'underline wavy red', [`TextDecorationLine`](/docs/extensions/html-svg/reference/values/textdecorationline/index.md) enum, or `null` to unset). |

**Returns**

`static`: New instance with the updated `text-decoration` attribute.

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

```php
public function textLength(float|int|string|null $value): static
```

Sets the SVG `textLength` attribute for the element.

Creates a new instance with the specified text length value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `float\|int\|string\|null` | Text length value (for example, '100', '50%', or `null` to unset). |

**Returns**

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

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

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

Sets the `title` attribute.

Usage example:
```php
$element->title('SVG text');
$element->title(null);
```

**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` | Advisory title text, or `null` to remove the attribute. |

**Returns**

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

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

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

Sets the SVG `transform` attribute for the element.

Creates a new instance with the specified transform value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string\|null` | Transform value (for example, 'rotate(45)', 'scale(2)', or `null` to unset). |

**Returns**

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

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

```php
public function wordSpacing(float|int|string|null $value): static
```

Sets the SVG `word-spacing` attribute for the element.

Creates a new instance with the specified word spacing value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `float\|int\|string\|null` | Word spacing value (for example, '5', '0.5em', 'normal', or `null` to unset). |

**Returns**

`static`: New instance with the updated `word-spacing` attribute.

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

```php
public function writingMode(string|UIAwesome\Html\Svg\Values\WritingMode|null $value): static
```

Sets SVG `writing-mode` attribute for the element.

Creates a new instance with the specified writing mode value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string\|`[`UIAwesome\Html\Svg\Values\WritingMode`](/docs/extensions/html-svg/reference/values/writingmode/index.md)`\|null` | Writing mode value to set for the element. Accepts 'horizontal-tb', 'vertical-rl', 'vertical-lr', 'sideways-rl', 'sideways-lr', [`WritingMode`](/docs/extensions/html-svg/reference/values/writingmode/index.md) enum, or `null` to unset. |

**Returns**

`static`: New instance with the updated `writing-mode` attribute.

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If the provided value is not a valid [`WritingMode`](/docs/extensions/html-svg/reference/values/writingmode/index.md) enum or string.

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

```php
public function x(float|int|string|null $value): static
```

Sets the SVG `x` attribute for the element.

Creates a new instance with the specified x-coordinate value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `float\|int\|string\|null` | X coordinate value (for example, '10', '10.3', '50%', or `null` to unset). |

**Returns**

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

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

```php
public function y(float|int|string|null $value): static
```

Sets the SVG `y` attribute for the element.

Creates a new instance with the specified y-coordinate value for the rendered element.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `float\|int\|string\|null` | Y coordinate value (for example, '20', '10.3', '50%', or `null` to unset). |

**Returns**

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

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

```php
protected function getTag(): BackedEnum
```

Returns the tag enumeration for the `<text>` element.

**Returns**

[`BackedEnum`](https://www.php.net/manual/en/class.backedenum.php): Tag enumeration instance for `<text>`. [`SvgBlock`](/docs/extensions/html-svg/reference/tag/svgblock/index.md) for valid SVG block-level tags.