openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

Question: How to implement link with an icon

Open DenisDuev opened this issue 2 years ago • 5 comments

OpenUI5 version:

Hi team, how I can implement a link with an icon as it is specified in the Fiori Guidelines: https://experience.sap.com/fiori-design-web/link/#link-with-icon

Like this one: image

What is the expected result?

The use case is having an icon in the link that point it is "External" link - will lead the user outside of the system

What happens instead?

I cannot implement the wanted behaviour even though it is described in the Fiori Guidelines

DenisDuev avatar Oct 11 '22 06:10 DenisDuev

Hi Denis,

The sap.m.Link control doesn't support an Icon yet, so you could use them only separately. It will not have the same effect however, for example the click will not be on the whole area, the underscore on hover will not be on both.

There are some discussions with VD design but it's not planned yet.

Best regards, Petya

petyabegovska avatar Oct 11 '22 08:10 petyabegovska

@DenisDuev maybe you can consider to handle this with CSS.

Basically you can set your icon via custom data and let this to be written to the html. Afterwards a ::before pseudo element can be used to use this custom data attribute and the SAP icon font. RTL needs to taken into account as well.

Please see https://jsbin.com/fesilutuja/1/edit?html,output

aborjinik avatar Oct 20 '22 12:10 aborjinik

Ah forgot to mention that you can find the icon symbols from the Icon Explorer application. e.g. https://sapui5.hana.ondemand.com/sdk/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/SAP-icons/?tab=grid&icon=world

PS: in the sample above I was trying to put the icon on the left as mentioned at the fiori guideline.

aborjinik avatar Oct 20 '22 12:10 aborjinik

Same request from https://answers.sap.com/questions/13834072/link-with-icon.html

boghyon avatar Mar 01 '23 19:03 boghyon

Hello @DenisDuev Thank you for sharing your enhancement proposal. I found an internal feature request already created about this under the id FIORITECHP1-26791. The status of the enhancement will also be updated here in GitHub. Regards, Georgi

georgimkv avatar Oct 02 '23 11:10 georgimkv