ui-kit icon indicating copy to clipboard operation
ui-kit copied to clipboard

Homogenize button and link behaviour and APIs

Open tdeekens opened this issue 5 years ago • 3 comments

Describe the bug

UI-Kit currently seems to have a quite board inventory of buttons and links. Often a button can act as a link. In many cases it's hard to get the desired behaviour while some buttons have different ways to. become a link.

To Reproduce

  1. SecondaryButton
    • Can become a link by receiving the linkTo prop
  2. PrimaryButton
    • Can become a link be receiving the as prop
  3. FlatButton
    • Can become a link with icon by passing icon and as (and to) prop

Expected behavior

A clean inventory of which buttons can become a link and in what cases a button should act as a link and when not. Also a homogenous API between buttons (e.g. no as prop but only linkTo) to transform a button into an accessible link.

tdeekens avatar Oct 02 '20 16:10 tdeekens

I agree that we need to have a consistent API to make the developer experience better.

What's the difference between Secondary, Primary, and Flat buttons when they act as a link? like background-color, color, border-color, padding etc? Based on these we can go in two ways.

  1. Considerable differences between the buttons: In this case, it's better to have a button that acts as a link.
  2. Not that much difference: Have a separate Link component instead of buttons whenever we want to have a link.

I haven't checked each individual button and its properties yet. I will update this comment after taking a look into those.

bradd123 avatar Mar 01 '21 19:03 bradd123

reference, feedback from UX. https://github.com/commercetools/ui-kit/pull/1830#issuecomment-803874780

adnasa avatar Mar 29 '21 13:03 adnasa

@FilPob todo: follow-up with the investigation. Thanks!

mmaltsev-ct avatar Jan 17 '22 09:01 mmaltsev-ct