commercetools / ui-kit

Component library 💅
https://uikit.commercetools.com
MIT License
144 stars 25 forks source link

Homogenize button and link behaviour and APIs #1607

Open tdeekens opened 4 years ago

tdeekens commented 4 years ago

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.

bradd123 commented 3 years ago

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.

adnasa commented 3 years ago

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

mmaltsev-ct commented 2 years ago

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