# Icon

[FontAwesome ](https://fontawesome.com/?from=io)icons to include in your dashboard. Icon names are slightly different than those shown on the FontAwesome website. For example, if you want to use the `network-wired` icon, you would use the following string.&#x20;

```powershell
New-UDIcon -Icon 'NetworkWired'
```

## Finding an Icon

We include FontAwesome v6 with PowerShell Universal. You can use `Find-UDIcon` to search through the list of included icons.&#x20;

```powershell
Find-UDIcon User
```

{% hint style="warning" %}
The `UniversalDashboard.FontAwesomeIcons` enum should not be used and is only included for backwards compatibility. Many of the icons are no longer a part of FontAwesome 6.
{% endhint %}

## Icon

Create icons by specifying their names. You can use the icon reference below to find icons.

```powershell
New-UDIcon -Icon 'AddressBook'
```

![](https://620394196-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-MFf-Pzf-axCqcawbEgL%2F-MFf-eXRSgDbNIKSa1iY%2Fimage.png?alt=media\&token=8e4f1f58-07ef-4110-ac4d-b1b552f3cb0d)

## Size

Set the size of the icon. Valid values are: `xs`, `sm`, `lg`, `2x`, `3x`, `4x`, `5x`, `6x`, `7x`, `8x`, `9x`, `10x`

```powershell
    New-UDIcon -Icon 'AddressBook' -Size 'sm'
    New-UDIcon -Icon 'AddressBook' -Size 'lg'
    New-UDIcon -Icon 'AddressBook' -Size '5x'
    New-UDIcon -Icon 'AddressBook' -Size '10x'
```

![](https://620394196-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-MFf-Pzf-axCqcawbEgL%2F-MFf0Q37ggj11tBw5Kr1%2Fimage.png?alt=media\&token=e3c70165-8b11-42a7-a030-623fe5998b3c)

## Rotation

Rotate icons. The value represents the degrees of rotation.

```powershell
New-UDIcon -Icon 'AddressBook' -Size '5x' -Rotation 90
```

![](https://620394196-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-MFf-Pzf-axCqcawbEgL%2F-MFf0qau89k6sheArT_b%2Fimage.png?alt=media\&token=bf585fbc-bbb6-4874-8620-e3bfbd641ca0)

## Border

Add a border to your icon.

```powershell
New-UDIcon -Icon 'AddressBook' -Size '5x' -Border
```

![](https://620394196-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-MFf1SO9oBiU5wq98AoI%2F-MFf1wjMNj4MMS5aO3ub%2Fimage.png?alt=media\&token=61ba8504-0060-420b-8f34-e8fdc5177c62)

## Style

Apply CSS styles to your icon.

```powershell
New-UDIcon -Icon 'AddressBook' -Size '5x' -Style @{
    backgroundColor = "red"
}
```

![](https://620394196-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-MFf1SO9oBiU5wq98AoI%2F-MFf25z0SeAcPV_QM94B%2Fimage.png?alt=media\&token=dac95fb3-a6bc-4f36-8704-d5257d42cfa3)

## Visually Search for Icons

```powershell
New-UDTextbox -Id 'txtIconSearch' -Label 'Search' 
New-UDButton -Text 'Search' -OnClick {
    Sync-UDElement -Id 'icons'
}

New-UDElement -tag 'p' -Content {}

New-UDDynamic -Id 'icons' -Content {
    $IconSearch = (Get-UDElement -Id 'txtIconSearch').value
    if ($null -ne $IconSearch -and $IconSearch -ne '')
    {
        $Icons =$Icons = Find-UDIcon -Name $IconSearch
    }

    foreach($icon in $icons) {
        try{
            New-UDChip -Label $icon -Icon (New-UDIcon -Icon $icon)
        }
        catch{
            New-UDChip -Label "$icon Unknown" 
        }
    }
}
```

## Complete Icon List

```powershell
 https://github.com/FortAwesome/Font-Awesome/blob/6.x/metadata/icons.json
```

## Custom Icons

You can use custom icon sets available on the [PowerShell Universal Modules](https://ironmansoftware.com/powershell-universal/modules) page. First, install the module and then use the icon with other components.&#x20;

```powershell
Install-Module Universal.Icons.Tabler
```

Within your dashboard, call the icon cmdlet.&#x20;

```powershell
New-UDButton -Icon (New-UDTablerIcon -Icon "Tb3DRotate")
```

## API

[**New-UDIcon**](https://github.com/ironmansoftware/universal-docs/blob/master/cmdlets/New-UDIcon.txt)
