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.

Button: Control Icon Size

See original GitHub issue

HI colleagues - we received the following issue on the React wrapper:

Original Issue: https://github.com/SAP/ui5-webcomponents-react/issues/365 Original Author: @isaqueha

Description I would like to control the size of an Icon inside a Button.

Is your feature request related to a problem? Please describe. I was developing a feature where a Button with a big Icon was needed, but there is no simple way to achieve that.

Describe the solution you’d like I would like a property inside the Button component to control the Icon size through CSS or so.

Describe alternatives you’ve considered I tried to alter several different CSS properties in the Button component so the Icon would be affected. No result so far. Some ideas:

Additional context As seen in the screenshot below, I wanted to make the sys-cancel Icon inside the Button as big as the search Icon in the left of the Bar:

image

The search Icon size was controlled with the width: 1.5rem CSS property.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
MarcusNotheiscommented, Mar 24, 2020

Hi @isaqueha, I think it should work with all components that are accepting the children prop. But whenever the typing says it’s a string or another primitive value it has to be handled with care 😄 I would rather recommend this approach as “last resort” in case nothing else helps.

1reaction
isaquehacommented, Mar 23, 2020

Thanks, @MarcusNotheis, @ilhan007 Your suggestions worked using the React Components!

Code:

image

Design:

image

@MarcusNotheis, will this “implicit Component” approach work similarly in other React Components when needed?

This workaround is enough for us right now 😄 Unless you want to keep it open for the feature suggestion, I believe we can close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What should be the size of an icon button? - LinkedIn
We could thus comfortably say that the safe limits of icon button sizes lie between 42 -72 px. However, we must remember that...
Read more >
How to setup Button component with varying icon sizes?
Figma Community file — A basic button component setup with precise control over different nested icons with varying icon sizes.
Read more >
Changing the Size of Icons
To increase the size of your icons, hold down the Ctrl key while you scroll up the mouse wheel.
Read more >
Bootstrap Icon size - free examples & tutorial
To increase icon sizes relative to their container, use fa-xs , fa-sm , fa-lg (33% increase), or use literal sizes (to scale it...
Read more >
The Complete Guide to Bootstrap Icon Button Size and Style
In this tutorial I will create several examples that style Bootstrap icon button width, height, border, color, and alignment. Here are the Icon...
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