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.

💬 Question

UI Kitten and Eva version

"@eva-design/eva": "^2.0.0-alpha.1",
"@ui-kitten/components": "^5.0.0-alpha.1",

Hi, I’m trying change the size of an icon on the Button element.

<Button style={styles.loginBtn} accessoryLeft={iconFacebook} ></Button>

const iconFacebook = (props: IconProps) => ( <Icon {...props} name="facebook"></Icon> );

How can I pass the height and width to the icon? Which type is the props parameter?

Btw, I love UI kitten, thank you for your awesome package.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

6reactions
artyorshcommented, Apr 26, 2020

@arthurliebhardt When there is a need to modify the existing props, keep in mind that you should also keep the initial stylings provided by the library.

// 1. Notice we have the props here. Provided by Eva and UI Kitten
// 2. In case of using `@ui-kitten/eva-icons` the icon you render is react-native-svg element,
//    so, to change the color you should use `fill` property
// 3. To extend or modify the initial stylings, we may use arrays.
const StarIcon = (props) => (
  <Icon {...props} style={[props.style, { width: 32, height: 32 }]} fill='red' name='star' />
);

<Button accessoryLeft={StarIcon} />

I suggest reading the official docs on styling for reference.

0reactions
arthurliebhardtcommented, Apr 26, 2020

@artyorsh ok, sorry didn’t know that. Thank you 😃 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Size Icons | Font Awesome Docs
Relative Sizing. Icons inherit the font-size of their parent container which allow them to match any text you might use with them.
Read more >
Icons · Bootstrap v5.0
Bootstrap Icons is a growing library of SVG icons that are designed by @mdo and maintained by the Bootstrap Team. The beginnings of...
Read more >
Bootstrap Icon size - free examples & tutorial
Responsive Icon size built with Bootstrap 5. Examples of ways to resize icons. How it works. To increase icon sizes relative to their...
Read more >
Icon Size Ratio Change CATIA V5 - YouTube
MenuTools → Customize → Options → Large Icons : Icon Size Ratio(Restart session to take settings into account)
Read more >
Icon API - Material UI - MUI
The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size. sx, Array<func | object | bool>...
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