# IconSet

> Provides the default SVG icons rendered by the widgets and lets applications replace them through the DI container.

[API reference](/docs/api/index.md) › [Bootstrap 6](/docs/extensions/bootstrap6/reference/index.md) › IconSet

| final class | `yii2\extensions\bootstrap6\IconSet` |
| --- | --- |
| Extends | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| Implements | [`yii\base\Configurable`](/docs/api/yii/base/configurable/index.md) |
| Source | [`src/IconSet.php`](https://github.com/yii2-extensions/bootstrap6/blob/main/src/IconSet.php#L20) |

Provides the default SVG icons rendered by the widgets and lets applications replace them through the DI container.

Widgets resolve the set with `Yii::createObject(IconSet::class)`, so a `container.definitions` entry for this class
replaces any icon globally. Every property holds its bundled default until the configuration overrides it.

See also: <https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg>.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-accordionChevron"></span>`$accordionChevron` | `string\|`[`Stringable`](https://www.php.net/manual/en/class.stringable.php) | Chevron rendered after each [`Accordion`](/docs/extensions/bootstrap6/reference/accordion/index.md) item label; receives the `accordion-icon` class. | `IconSet` |
| <span id="property-comboboxCaret"></span>`$comboboxCaret` | `string\|`[`Stringable`](https://www.php.net/manual/en/class.stringable.php) | Caret rendered inside the [`Combobox`](/docs/extensions/bootstrap6/reference/combobox/index.md) toggle; receives the `combobox-caret` class. | `IconSet` |
| <span id="property-menuItemCheck"></span>`$menuItemCheck` | `string\|`[`Stringable`](https://www.php.net/manual/en/class.stringable.php) | Check mark rendered inside each [`Combobox`](/docs/extensions/bootstrap6/reference/combobox/index.md) item; receives the `menu-item-check` class. | `IconSet` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Builds the bundled defaults before the configuration replaces any of them. | `IconSet` |
| <span id="method-__call"></span>[`__call()`](/docs/api/yii/base/baseobject/index.md#method-__call) | Calls the named method which is not a class method. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__get"></span>[`__get()`](/docs/api/yii/base/baseobject/index.md#method-__get) | Returns the value of an object property. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__isset"></span>[`__isset()`](/docs/api/yii/base/baseobject/index.md#method-__isset) | Checks if a property is set, i.e. defined and not null. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__set"></span>[`__set()`](/docs/api/yii/base/baseobject/index.md#method-__set) | Sets value of an object property. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__unset"></span>[`__unset()`](/docs/api/yii/base/baseobject/index.md#method-__unset) | Sets an object property to null. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-canGetProperty"></span>[`canGetProperty()`](/docs/api/yii/base/baseobject/index.md#method-canGetProperty) | Returns a value indicating whether a property can be read. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-canSetProperty"></span>[`canSetProperty()`](/docs/api/yii/base/baseobject/index.md#method-canSetProperty) | Returns a value indicating whether a property can be set. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-className"></span>[`className()`](/docs/api/yii/base/baseobject/index.md#method-className) static | Returns the fully qualified name of this class. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-hasMethod"></span>[`hasMethod()`](/docs/api/yii/base/baseobject/index.md#method-hasMethod) | Returns a value indicating whether a method is defined. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-hasProperty"></span>[`hasProperty()`](/docs/api/yii/base/baseobject/index.md#method-hasProperty) | Returns a value indicating whether a property is defined. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-init"></span>[`init()`](/docs/api/yii/base/baseobject/index.md#method-init) | Initializes the object. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| [`render()`](#method-render) static | Returns the markup of an icon with its structural CSS class. | `IconSet` |

## Method details

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

```php
public function __construct(array<string, mixed> $config = [])
```

Builds the bundled defaults before the configuration replaces any of them.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$config` | `array<string, mixed>` | Name-value pairs that override the default icons. |

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

```php
public static function render(string|Stringable $icon, string $class): string
```

Returns the markup of an icon with its structural CSS class.

A `\UIAwesome\Html\Svg\Svg` instance receives `$class` appended to its own classes (html-svg skips a class it already carries).
Any other value is cast to `string` verbatim, so plain markup and other `Stringable` objects must already carry
the class.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$icon` | `string\|`[`Stringable`](https://www.php.net/manual/en/class.stringable.php) | Icon to render. |
| `$class` | `string` | Structural CSS class the Bootstrap stylesheet targets, for example `accordion-icon`. |

**Returns**

`string`