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.

When making a Button with an icon only, the icon is not centered

See original GitHub issue

The icon component inside Button adds a marginRight: 15px, what makes the icon get uncentered… the only way I found to fix this is…

<Button icon={{ name: 'filter-list', style: { marginRight: 0 } }}/>

captura de pantalla 2017-12-08 a la s 1 20 10 p m

Issue Analytics

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

github_iconTop GitHub Comments

6reactions
xavier-villelegiercommented, Dec 8, 2017

Hey @hendrul, I advise you to use the Icon component if you just need a clickable icon, as suggested in #639

1reaction
xavier-villelegiercommented, Apr 1, 2018

Just FYI, in the v1.0.0-beta4 coming soon, the icon should be centered if you provide title={null} or title=""

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why are Icon-Buttons not centered? - Stack Overflow
Actually his answer was quite precise. By suppressing IconButton's padding, the icon will look like centered in parent's area. – Víctor Hugo.
Read more >
Button and Icon Not Centering - HTML - Codecademy Forums
The text in the section is centering but I cannot figure out why the icon and and button are not also centered.
Read more >
icon of su_button non centered | WordPress.org
This avoids me to manage texts in multilanguage pages. But, the icon is not centered, even with lack of text. The icon is...
Read more >
IconButton class - material library - Flutter - Dart API docs
Defines how the icon is positioned within the IconButton. ... True if this widget will be selected as the initial focus when no...
Read more >
How to target all Font Awesome icons and align them center?
The most preferred way to center Font Awesome Icons is to assign a center class to each <i> tag. Setting width to 100%,...
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