Making WordPress.org

Opened 16 months ago

Last modified 10 months ago

#4949 new defect

Add further Examples on Dashicons Page

Reported by: derweili Owned by:
Milestone: Priority: low
Component: Developer Hub Keywords:


The Dashicons Documentation https://developer.wordpress.org/resource/dashicons/#art shows code examples for using Dashicons in a custom post type and in HTML/CSS.

Dashicons are also used for Blocks in Gutenberg Editor and Taxonomies.

Maybe we should also add examples for these use cases.

Change History (2)

#1 @desrosj
10 months ago

Thanks for this, @derweili! These examples should definitely be added to the bottom of the page.

Pinging @joen as this will be of interest to him as well.

#2 @Joen
10 months ago

Thanks for the ticket! Dashicons are not as widely used in the block editor any more, and the preferred syntax for block icons leverages the new icon syntax. This syntax:


This leverages the actual markup served in that constant, rather than being the name of an icon in a sprite. That also enables custom SVGs in an easier way.

I don't think the Dashicons component bundled with the block editor is deprecated, or will be any time soon. But it's a little bit a legacy way of doing it.

Note: See TracTickets for help on using tickets.