> For the complete documentation index, see [llms.txt](https://posttypes.jjgrainger.co.uk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://posttypes.jjgrainger.co.uk/post-types/define-icon.md).

# Define an icon

[Dashicons](https://developer.wordpress.org/resource/dashicons/) is an icon font you can use with your post types.

To set the post type icon pass the dashicon icon slug in the `icon()` method.

```php
use PostTypes\PostType;

class Books extends PostType
{
    //...

    /**
     * Returns the admin menu icon for the Books post type.
     *
     * @return string
     */
    public function icon(): string
    {
        return 'dashicons-book-alt';
    }
}
```

A list of available icons can be found on the [WordPress documentation](https://developer.wordpress.org/resource/dashicons/)
