# Icon

> Renders SVG icons bundled with the debug extension via UIAwesome\Html\Svg\Svg::tag().

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Helper](/docs/extensions/debug-core/reference/helper/index.md) › Icon

| final class | `PHPForge\Debug\Helper\Icon` |
| --- | --- |
| Source | [`src/Helper/Icon.php`](https://github.com/php-forge/debug-core/blob/main/src/Helper/Icon.php#L16) |

Renders SVG icons bundled with the debug extension via [`Svg::tag()`](/docs/extensions/html-core/reference/base/basetag/index.md#method-tag).

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`render()`](#method-render) static | Returns the rendered SVG markup for the given icon name, or an empty string when the file does not exist. | `Icon` |

## Constants

| Constant | Value | Description | Defined by |
| --- | --- | --- | --- |
| <span id="const-KEY_PATTERN"></span>`KEY_PATTERN` | `'/\A[a-z0-9][a-z0-9-]*\z/'` | Shape an icon key must match: lowercase alphanumerics and hyphens, starting with an alphanumeric. | `Icon` |

## Method details

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

```php
public static function render(string $name): string
```

Returns the rendered SVG markup for the given icon name, or an empty string when the file does not exist.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$name` | `string` | Icon basename without the `.svg` extension (for example, `chevron-down`). |

**Returns**

`string`: Sanitized SVG markup, or `''` when the source file is missing.