In this post I am going to explain how to add tooltip in ui_component form field in Magento 2.
Check the below example code snippet to add tooltip in ui_component form field.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <field name="identifier" formElement="hidden"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">text</item> <item name="label" xsi:type="string" translate="true">Identifier</item> <item name="formElement" xsi:type="string">input</item> <item name="source" xsi:type="string">identifier</item> <item name="dataScope" xsi:type="string">identifier</item> </item> </argument> <settings> <dataType>text</dataType> <tooltip> <link>https://www.google.com</link> <description translate="true">Tool-tip content for the identiier field.</description> </tooltip> </settings> </field> |
Here under “<settings>” tag “<tooltip>” tag is used to add tooltip.
<link> – Link will redirect to specific page on click of tooltip icon.
<description> – Display text on tooltip icon hover.
Thats it. Enjoy Magento 2!!
Leave a Reply