question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Summary

I’d like to propose that icon-only buttons become a use-case of the Button component. This UX pattern is currently used by other components (overflow menu, data table, tooltip) but having it be part of Button will allow for more consistent [re-]use within applications.

Currently I’ve only seen this used with the ghost and primary variants by our design guidelines for compact UIs but we don’t limit which variant could be used. With Carbon 9 it didn’t create an issue but the Carbon X’s extra padding/min-width creates an odd visual style.

Relevant information

Examples from Watson Health

By default icon-only buttons are not very accessible for cognitive disabilities, so Watson Health has added a textual description when the button is hovered/focus for users to get more information about what the button does. See demo here: https://pages.github.ibm.com/Watson-Health/components/preview/button--icon-only.html

Screen shots from our design guidelines Different variants screen shot 2019-01-30 at 1 09 39 pm Different sizes screen shot 2019-01-30 at 1 09 45 pm

Slack conversation in carbon-components

Liz Judd: Does Carbon provide Icon only button code? When I use the Carbon X button styles, it looks odd with the space to the left of the icon

Josh Black: AFAIK we don’t provide an icon button

Liz Judd: Is that something that’s being considered? Should I make an issue for it or keep it custom to our setup

Josh Black: It’s not on any roadmap for components, I believe. Might be worth bringing up to see if this is a UX pattern that is supported or not

Liz Judd: It’s used by overflow menu and the toolbar for data tables which is why I’m surprised that it’s not something that’s available. I’ll create an issue to start the conversation

Josh Black: I think the style for those aren’t coming from the underlying button component though, right? Which is why they might be distinct stylistically

Liz Judd: I just mean that it’s a practice that is used by other components so why it wouldn’t be offered stand-alone seems odd so consumers could use them in other locations other than those specific components

Alessandra Davila What is your use case for a icon button. I think overflow menu work differently than how a button works

Liz Judd Compact UIs

Liz Judd We deal a lot with big data and can have very overwhelming layouts so the use of icon-only buttons help clean up the space

Josh Black I believe Cloud would have a similar use-case for compactness, right? Particularly around data density.

Liz Judd It’s also used by tooltip and data table so it’s not just a one off for overflow menu

Josh Black I think we need to distinguish between an icon used in a button semantically and a button icon styled by the primary button styles, right?

Josh Black We definitely use the former in widgets 👍 The latter is what I thought we were referring to here but let me know if I’m wrong

Liz Judd i don’t know if i understand what you mean by a icon used in a button and button icon. They should all be in button elements as they perform an action

Josh Black An icon used in a button: <button><svg>...</svg></button> A button icon: <button class="bx--btn">...</button> Is all I meant

Josh Black Right, but it seemed like you were asking about a button styled like the button components

Liz Judd oh yes, we primarily use the ghost button variant. we don’t technically limit our users though and they could use any button variant

Josh Black Right, we should sync on if that’s consistent UX behavior then. In cloud I believe that pattern isn’t used which is why this isn’t currently supported, most likely.

Liz Judd I’ll create a discussion issue vs feature request

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
asudohcommented, Jan 30, 2019

As far as I see, icon is used for its intuitiveness and its simplicity. Some design systems prefers icons over text, while some doesn’t. OTOH @dakahn has a good point with his reference that icon sometimes cause confusions - I guess more traffic signs in the US are in text than ones in Japan from that reason, which is, multi-cultural nature of the US tends to have multiple perceptions of a single icon.

That said, I see this topic is a designers’ choice. That’s why input from our designers is important here, as @joshblack solicited for earlier. A response from our designer can be found at: https://github.com/IBM/carbon-components/issues/1667#issuecomment-458273025

0reactions
asudohcommented, Feb 4, 2019

Closing for the sake of #1667, don’t hesitate to speak up if anybody thinks this ticket should be separate - Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Create Icon Buttons - W3Schools
How To Create Icon Buttons. Step 1) Add HTML: Add an icon library, such as font awesome, and append icons to HTML buttons: ......
Read more >
Do you need an ICON ONLY button without screwing up the ...
The first consideration is: do you really? If you can, having text next to your icons is proven over and over again to...
Read more >
ion-button - Ionic Framework
ion-button provides a clickable element for use anywhere needing standard button functionality. Design and style button elements with custom CSS properties.
Read more >
Ionic Ion-Button icon-only - Stack Overflow
I set up a new project and want to design a small menu at the bottom of the foot of my page. I...
Read more >
Icon Only Button - Universal Theme - Oracle APEX
This is an icon only button useful for easily recognized actions. Set Icon as the Button Template. Examples. 1. Default. 2. Variations. Template...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found