0

I'd like to add an icon like this image below, my custom module creates a new tab on this same route Stores > Settings > Configuration.

So how can I add an icon like that red?

Magento 2 admin tabs with icon

Thanks

1 Answer 1

0

I haven't tested this, but it looks like it might work.
Make the system.xml look like this:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <section id="section_id_here" translate="label" type="text" sortOrder="400" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Section label here</label>
            <tab>tab_name_here</tab>
            <resource>Vendor_Module::acl_name</resource>
            <class>my-custom-class</class>
        </section>
    </system>
</config>

Now you get a special class (my-custom-class) added to your section and you can control that via css files.

It works for tabs also but a bit different.
The class must be added as an attribute

   <tab id="tab_id_here" translate="label" sortOrder="400" class="my-tab-class">
        <label>Tab label</label>
    </tab>
2
  • not sure exactly what you needed so I added an answer for both sections and tabs.
    – Marius
    Commented May 24, 2017 at 21:50
  • Hello Marius thanks for you answer i am strucked where should I add css ?
    – Waqar Ali
    Commented Sep 1, 2020 at 6:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.