Skip to main content

UI Icons 2.x, what's next

UI Icons icon gallery

In 2024 I introduced my new module UI Icons, a generic icon pack manager for Drupal and UI Patterns . The article ended on a proposal: move the base of the module into Drupal core.

That happened: the Icon API has been part of core since Drupal 11.1. Declaring packs in a *.icons.yml file now lives in core, and UI Icons focuses on the rest: selectors, fields, menus, CKEditor 5, media and UI Patterns.

What changes in 2.x

The 2.x branch targets Drupal 11.3 and Drupal 12. It no longer ships the backport and Iconify submodules, which the core API left empty. Coming from 1.1.x, run the database updates: ui_icons_update_11201 uninstalls them.

2.0.0 came out on August 3, 2026, and 2.1.0 on October 22. The 2.0.x branch is already unsupported: go straight to 2.1.x, it has the same requirements. 1.1.x only gets security fixes, until January 31, 2027.

A new selector

The most visible change is the UI Icons Popover submodule: a selector that opens in place, with icons sorted into groups. It becomes the default selector, and the modal picker is deprecated.

The autocomplete preview becomes clickable, like an emoji picker: type a name to search, or click to browse. Results can also show as a grid:

$form['icon'] = [
  '#type' => 'icon_autocomplete',
  '#title' => $this->t('Icon'),
  '#allowed_icon_pack' => ['my_icon_pack'],
  '#show_settings' => TRUE,
  '#result_format' => 'grid',
];

Better integrated

2.1 also brings:

  • the icon library renders with the front theme, so with the real icon styles;
  • a text format only renders icons from the packs it allows;
  • menus can set the selector and the allowed packs;
  • an Icon field keeps the settings of each value.

On the component side, UI Patterns 2 gets an icon prop type:

props:
  type: object
  properties:
    icon:
      title: 'Icon'
      $ref: 'ui-patterns://icon'

In the template: {{ icon(icon.pack_id, icon.icon_id, icon.settings) }}.

The challenges

Drupal 12 compatibility took a pass over the whole module. A code review also found slow icon searches: 2.1 speeds up the autocomplete and the picker. A quieter bug: submitting the form while the autocomplete's Ajax request was still running. The submit button now waits for the request to finish.

What's next

UI Icons Picker will be removed in 3.0, in favor of UI Icons Popover. If you are still on 1.1.x, plan the upgrade before security support ends.

Tell me about your project

Describe your site and what you need. I'll reply within 2 business days. The quote is free.

Or by email: contact[at]developpeur-drupal[dot]com