Icon

In this article

See the WordPress Storybook for more detailed, interactive documentation.

Renders a raw icon without any initial styling or wrappers.

import { wordpress } from '@wordpress/icons';

<Icon icon={ wordpress } />

Props

icon

  • Type: IconType
  • Required: No
  • Default: null

The icon to render. In most cases, you should use an icon from
the @wordpress/icons package.

Other supported values are: component instances, functions,
Dashicons
(specified as strings), and null.

The size value, as well as any other additional props, will be passed through.

size

  • Type: number
  • Required: No
  • Default: 'string' === typeof icon ? 20 : 24

The size (width and height) of the icon.

Defaults to 20 when icon is a string (i.e. a Dashicon id), otherwise 24.