# Are we able to move icons from one ribbon tab to another?

**URL:** <https://pdfjs.community/t/are-we-able-to-move-icons-from-one-ribbon-tab-to-another/556>\
**Category:** Technical Support\
**Created:** [March 3, 2021, 1:05pm UTC](https://pdfjs.community/t/are-we-able-to-move-icons-from-one-ribbon-tab-to-another/556 "2021-03-03T13:05:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [March 4, 2021, 3:39pm UTC](https://pdfjs.community/t/are-we-able-to-move-icons-from-one-ribbon-tab-to-another/556/2 "2021-03-04T15:39:03Z")

</div>

Hey there!

This is a bit painful, but it is possible. I wrote a function you can use to move items between ribbons.

```javascript
  const moveItem = (toolName, fromRibbon, toRibbon) => {
    instance.setHeaderItems((header) => {
      const ribbon = header.getHeader(fromRibbon);
      const tool = ribbon.get(toolName)
      ribbon.delete(toolName);

      const ribbon2 = header.getHeader(toRibbon);
      ribbon2.push(tool);
      return header;
    })
  }

```

You can use it like so:

```javascript
  // move the shape tool to from the "Annotate" ribbon to the "Shapes" ribbon
  moveItem(
    'shapeToolGroupButton',
    'toolbarGroup-Annotate',
    'toolbarGroup-Shapes'
  );

```

The first parameter is the name of the tool, which you can get by hovering over it in the dev console and finding the ‘data-element’ attribute.

The second parameter is the name of the ribbon you want to move FROM, and the third parameter is the name of the ribbon you want to move TO. You can find these by hovering over the ribbons as well.

Thanks!  
Logan

---

_[View the full topic](https://pdfjs.community/t/are-we-able-to-move-icons-from-one-ribbon-tab-to-another/556)._
