Clay: Clay Link and Button should have props that make it possible to look like the other component

Created on 1 Jun 2020  路  3Comments  路  Source: liferay/clay

After a lengthy discussion with @jbalsas we decided to let others speak for a bit on the topic.

What is your proposal?

In many places we have Links that look like Buttons, and Buttons that look like Links.
I want to discuss what you think is the proper API for it.

Right now, for Buttons, we have displayType="link": <ClayButton displayType="link" />, which will render a Button that looks like a link, and that's great. We're missing the same functionality for ClayLink.

Why would adopting this proposal be beneficial?

We have plenty of cases in DXP where keeping the functionality of a Button/Link is key, but we want the look of the other component.

rfc

Most helpful comment

Maybe this should be a separate issue, but I was thinking it would be a good idea to output the attribute rel="noreferrer noopener" when someone uses ClayLink or ClayButton with the target attribute.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Attributes (scroll down to target) and https://mathiasbynens.github.io/rel-noopener/

All 3 comments

Maybe this should be a separate issue, but I was thinking it would be a good idea to output the attribute rel="noreferrer noopener" when someone uses ClayLink or ClayButton with the target attribute.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Attributes (scroll down to target) and https://mathiasbynens.github.io/rel-noopener/

Maybe this should be a separate issue, but I was thinking it would be a good idea to output the attribute rel="noreferrer noopener" when someone uses ClayLink or ClayButton with the target attribute.

That's a great catch @pat270!! We've had several security reports from customer in the past year regarding this... let's spin off some tasks to make sure we follow this! This needs to be overridable because there are some legit cases, though!

Was this page helpful?
0 / 5 - 0 ratings