ui-kit
ui-kit copied to clipboard
Homogenize button and link behaviour and APIs
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
- SecondaryButton
- Can become a link by receiving the
linkToprop
- Can become a link by receiving the
- PrimaryButton
- Can become a link be receiving the
asprop
- Can become a link be receiving the
- FlatButton
- Can become a link with icon by passing
iconandas(and to) prop
- Can become a link with icon by passing
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.
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.
- Considerable differences between the buttons: In this case, it's better to have a button that acts as a link.
- 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.
reference, feedback from UX. https://github.com/commercetools/ui-kit/pull/1830#issuecomment-803874780
@FilPob todo: follow-up with the investigation. Thanks!