Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn the button into a link when href is provided #2864

Merged

Conversation

marcoambrosini
Copy link
Contributor

Sometimes is useful to have links that are styled as buttons. This
allows to pass in an href prop to the button component and turns the
native root html element into an a when that's provided.

Signed-off-by: Marco Ambrosini marcoambrosini@pm.me

Sometimes is useful to have links that are styled as buttons. This
allows to pass in an href prop to the button component and turns the
native root html element into an `a` when that's provided.

Signed-off-by: Marco Ambrosini <marcoambrosini@pm.me>
@marcoambrosini marcoambrosini added 3. to review Waiting for reviews accessibility Making sure we design for the widest range of people possible, including those who have disabilities labels Jul 20, 2022
@marcoambrosini marcoambrosini self-assigned this Jul 20, 2022
Copy link
Contributor

@CarlSchwan CarlSchwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Copy link
Contributor

@raimund-schluessler raimund-schluessler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works

@raimund-schluessler
Copy link
Contributor

We could also check if there is the to prop set, and alternatively make it a router-link if present.

@raimund-schluessler raimund-schluessler added this to the 5.4.0 milestone Jul 20, 2022
Co-authored-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>

Signed-off-by: Marco <marcoambrosini@pm.me>
@marcoambrosini
Copy link
Contributor Author

We could also check if there is the to prop set, and alternatively make it a router-link if present.

Follow up!

@marcoambrosini marcoambrosini merged commit 32c74c6 into master Jul 20, 2022
@marcoambrosini marcoambrosini deleted the feature/noid/make-button-a-when-href-is-provided branch July 20, 2022 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews accessibility Making sure we design for the widest range of people possible, including those who have disabilities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants