flowbite-svelte icon indicating copy to clipboard operation
flowbite-svelte copied to clipboard

Allow a button to look like a link or link to work like a button

Open gregg-cbs opened this issue 1 year ago • 2 comments

Summary

Its common to have an element that looks like a link but behaves like a button. Its a button that looks like a link.

Basic example

Currently with the link component you can add an on:click but this still triggers a page load with a # as the href.

<!-- this will work but it sends the page scroll to the top because of the default href as # -->
<A on:click={()=> show_full_link = !show_full_link}>view full link</A>

As for button there is no way to make a button look like a link, a prop detailing it should look like a link would be amazing:

<Button as="link" on:click={()=> show_full_link = !show_full_link}>view full link</Button>

Motivation

To be able to have buttons that look like links.

gregg-cbs avatar Jul 05 '24 10:07 gregg-cbs

I think this can be confusing for users, especially those who rely on visual cues to navigate. Screen readers might also misinterpret the element.

shinokada avatar Jul 06 '24 07:07 shinokada

This is beneficial to screen readers - you dont want someone using a link just to get something that looks like a link when they should be using a button.

gregg-cbs avatar Jul 07 '24 09:07 gregg-cbs