How to set target _blank on a button?

any way to set target=“_blank” on a button?

you can do it for links, just check the “Open in new tab?” HTML Attribute:

image.png

I think this attribute is only valid for links (<a>)

Ah ok thanks. I guess in a component can I add it as a slot?

In the official plasmic template I used, there was a button that was using a meta prop for link

should we use meta props? Or slots? I can probably just recreate the component that came with the template

slots are “placeholders” in the component that can be replaced by any other element - so you could replace the link by anything else (including another link with the target attr set).

if you only need to set the target attr instead of completely replacing the elements, it might make more sense to use a meta prop and just link it to the element

Was there ever a resolution to this? I am using the new customizable components button and I set up an on click interaction to open a url, but I want to be able to specify target=“_blank.” Please help. Thanks.

Hi, yes this is a known issue, we will be working on it.

1 Like

You can also wrap the button inside an anchor tag.

Hello @higinio_maycotte We have pushed an update to this - you should now be able to set href (via “Link to” prop) and target (via “Open Link in New Tab” prop) in the customizable Button component.

1 Like

TYSM. I :heart: Plasmic!