Carbon: Add Button iconPosition prop

Created on 5 Oct 2020  路  3Comments  路  Source: carbon-design-system/carbon

Summary

Add an iconPosition prop to the Button component in order to position its icon to the left or to the right.

Justification

Some icon buttons need to be positioned to the left of its label rather than on the other side, for context meaning purposes.

Desired UX and success metrics

When the iconPosition is set to 'left', the button icon should be placed on the left of the label. The (current) default behaviour would be achieved by setting it to the 'right'.

"Must have" functionality

  • [ ] Add iconPosition and change its styles accordingly (left/right margins)

Specific timeline issues / requests

It is not related to any release.

_NB: The Carbon team will try to work with your timeline, but it's not
guaranteed. The earlier you make a request in advance of a desired delivery
date, the better!_

visual 馃帹 waiting for author's response 馃挰 enhancement 馃挕

All 3 comments

I don't believe design allows for the icon to be placed on the left of the text.

https://www.carbondesignsystem.com/components/button/usage#buttons-with-icons

Screen Shot 2020-10-06 at 10 23 00 AM

cc @carbon-design-system/design is this guidance still correct?

Yes, the icon should always remain to the right of the text in a button. This is the icon guidance that we follow from the IBM Design Language. This allows for better vertical text alignment on the page between elements.

Closing as resolved, thanks for chiming in @laurenmrice!

Was this page helpful?
0 / 5 - 0 ratings