Skip to content
PHP Ecosystem
Explore

Stop

API reference › HTML SVG › Stop

Represents the SVG <stop> element for defining gradient stop positions and colors.

Provides a concrete <stop> element implementation that returns SvgVoid::STOP and provides stop attribute methods.

The <stop> element defines a color stop for gradients such as <linearGradient> and <radialGradient>.

See also: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/stop (BaseVoid for the base implementation.).

PropertyTypeDescriptionDefined by
$attributes protectedmixed[]HTML attributes array used by the implementing class. Default: [].UIAwesome\Html\Mixin\HasAttributes
MethodDescriptionDefined by
__construct() finalInitializes a new tag instance.UIAwesome\Html\Core\Base\BaseTag
__toString()Returns the rendered tag string.UIAwesome\Html\Core\Base\BaseTag
accesskey()Sets the accesskey attribute.UIAwesome\Html\Attribute\Global\HasAccesskey
addAriaAttribute()Sets an aria-* attribute.UIAwesome\Html\Attribute\Global\HasAria
addAttribute()Adds or updates a single HTML attribute for the element.UIAwesome\Html\Mixin\HasAttributes
addDataAttribute()Sets a data-* attribute.UIAwesome\Html\Attribute\Global\HasData
addEvent()Sets an on* event attribute.UIAwesome\Html\Attribute\Global\HasEvents
ariaAttributes()Sets multiple aria-* attributes.UIAwesome\Html\Attribute\Global\HasAria
attributes()Adds or updates multiple HTML attributes for the element.UIAwesome\Html\Mixin\HasAttributes
class()Sets the class attribute.UIAwesome\Html\Attribute\Global\HasClass
config()Applies application-scoped config recipes to this tag.UIAwesome\Html\Core\Base\BaseTag
dataAttributes()Sets multiple data-* attributes.UIAwesome\Html\Attribute\Global\HasData
dir()Sets the dir attribute.UIAwesome\Html\Attribute\Global\HasDir
events()Sets multiple on* event attributes.UIAwesome\Html\Attribute\Global\HasEvents
getAttribute()Returns the value of a single HTML attribute.UIAwesome\Html\Mixin\HasAttributes
getAttributes()Returns the array of HTML attributes for the element.UIAwesome\Html\Mixin\HasAttributes
hidden()Sets the hidden attribute.UIAwesome\Html\Attribute\Global\CanBeHidden
id()Sets the id attribute.UIAwesome\Html\Attribute\Global\HasId
lang()Sets the lang attribute.UIAwesome\Html\Attribute\Global\HasLang
offset()Sets the SVG offset attribute for the element.Stop
removeAriaAttribute()Removes an aria-* attribute.UIAwesome\Html\Attribute\Global\HasAria
removeAttribute()Removes a specific HTML attribute from the element.UIAwesome\Html\Mixin\HasAttributes
removeDataAttribute()Removes a data-* attribute.UIAwesome\Html\Attribute\Global\HasData
removeEvent()Removes an on* event attribute.UIAwesome\Html\Attribute\Global\HasEvents
render() finalRenders the tag with lifecycle hooks.UIAwesome\Html\Core\Base\BaseTag
replaceAttributes()Replaces all HTML attributes for the element.UIAwesome\Html\Mixin\HasAttributes
role()Sets the role attribute.UIAwesome\Html\Attribute\Global\HasRole
stopColor()Sets the SVG stop-color attribute for the element.Stop
stopOpacity()Sets the SVG stop-opacity attribute for the element.Stop
style()Sets the style attribute.UIAwesome\Html\Attribute\Global\HasStyle
tag() staticCreates and configures a new tag instance.UIAwesome\Html\Core\Base\BaseTag
title()Sets the title attribute.UIAwesome\Html\Attribute\Global\HasTitle
translate()Sets the translate attribute.UIAwesome\Html\Attribute\Global\HasTranslate
afterRun() protectedPost-processes rendered output.UIAwesome\Html\Core\Event\HasAfterRun
beforeRun() protectedValidates state before rendering.UIAwesome\Html\Core\Event\HasBeforeRun
getTag() protectedReturns the tag enumeration for the <stop> element.Stop
loadDefault() protectedReturns class-level default definitions.UIAwesome\Html\Core\Base\BaseTag
run() protectedRenders the void element.UIAwesome\Html\Core\Element\BaseVoid
public function offset(float|int|string|null $value): static

Sets the SVG offset attribute for the element.

Creates a new instance with the specified gradient stop offset value for the rendered element.

Parameters

ParameterTypeDescription
$valuefloat|int|string|nullOffset value (for example, ‘0.25’, ‘50%’, or null to unset).

Returns

static: New instance with the updated offset attribute.

Throws

  • InvalidArgumentException: If the value is outside the allowed range (‘0’-‘1’, or ‘0’-‘100%’) and not null.
public function stopColor(string|null $value): static

Sets the SVG stop-color attribute for the element.

Creates a new instance with the specified gradient stop color value for the rendered element.

Parameters

ParameterTypeDescription
$valuestring|nullStop color value (for example, ‘#ff0000’, ‘currentColor’, or null to unset).

Returns

static: New instance with the updated stop-color attribute.

public function stopOpacity(float|int|string|null $value): static

Sets the SVG stop-opacity attribute for the element.

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

Parameters

ParameterTypeDescription
$valuefloat|int|string|nullStop opacity value (for example, ‘0.5’ or null to unset).

Returns

static: New instance with the updated stop-opacity attribute.

Throws

protected function getTag(): BackedEnum

Returns the tag enumeration for the <stop> element.

Returns

BackedEnum: Tag enumeration instance for <stop>. SvgVoid for valid SVG void-level tags.