Button that acts like a link? #3459
Answered
by
reidbarber
emipallares
asked this question in
Q&A
-
Hi, In order to have a button that acts like a link (e.g. open a new tab to another page) that's what I'm currently doing: <a
href="https://adobe.com"
target="_blank"
rel="noreferrer"
style={{
color: 'inherit',
textDecoration: 'inherit',
}}
>
<Button variant="primary" UNSAFE_style={{ cursor: 'pointer' }}>
Take the tour
</Button>
</a> Is there a way we could achieve the same behaviour (even with styles) with React Spectrum? I'm new to it and I was looking for something like a LinkButton. Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
reidbarber
Aug 29, 2022
Replies: 1 comment 1 reply
-
This is actually already supported within Button: <Button variant="primary" elementType="a" href="https://adobe.com" target="_blank" rel="noreferrer">
Take the tour
</Button> |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
emipallares
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is actually already supported within Button: