Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change size and color for icon #67

Closed
NgKhanh opened this issue Nov 9, 2016 · 17 comments
Closed

How to change size and color for icon #67

NgKhanh opened this issue Nov 9, 2016 · 17 comments

Comments

@NgKhanh
Copy link

NgKhanh commented Nov 9, 2016

Hello, I read document I see this code
<Icon size={30} color='aliceblue' style={{ ... }} />

But I dont understand how to use this, e.x I want to user MdStar with size:2em, color=blue
<MdStar size={2} color="blue">

Is it ? Pls give more code

@nguyenmanh1507
Copy link

convert em to pixel and set color for parent el. ex:
parent element font-size = 16px => 2em = 32px

<div style={{color: 'blue'}}>
  <MdStar size={32} />
</div>

@bentatum
Copy link
Collaborator

The size prop only accepts pixels as an integer value. The color prop should work, is it not for you?

@NgKhanh
Copy link
Author

NgKhanh commented Nov 27, 2016

Thanks, I did it

@NgKhanh NgKhanh closed this as completed Nov 27, 2016
@danieli45
Copy link

thanks!

@imrishav
Copy link

imrishav commented Aug 4, 2020

Easiest way to Change style of icon is using this

import { FaThumbsDown, FaThumbsUp } from 'react-icons/fa';
<FaThumbsDown size={30} style={{ fill: 'black' }} />

@lawson-ng
Copy link

style={{ fill: 'black' }}

It works well. Many thanks

@andreferreiradaweb
Copy link

How to set :hover value on react-icons ?

@greatertomi
Copy link

How to set :hover value on react-icons?

&:hover { height: 30px; width: 40px; }

this increases the size during hover

@debora-maciel
Copy link

Hello, I read document I see this code
<Icon size={30} color='aliceblue' style={{ ... }} />

But I dont understand how to use this, e.x I want to user MdStar with size:2em, color=blue
<MdStar size={2} color="blue">

Is it ? Pls give more code

it rlly helped :') thk

@cryskram
Copy link

<FaFacebookMessenger size={100} color={"yellow"} />

Adds a size of 100 and color yellow to the FacebookMessenger icon

@ziaaurrehman
Copy link

thanks 👍

@Nishanth-sebastin
Copy link

Thanks itz worked

@samueljohnson96
Copy link

thank you!

@juanigarciadev
Copy link

style={{ fill: 'black' }} />`

It worked for me, thanks!

@omarmazin
Copy link

<Icon size={10}/>

@smileyyismail
Copy link

some icons do not accept color so try different one

@sudo-001
Copy link

sudo-001 commented Dec 5, 2023

Easiest way to Change style of icon is using this

import { FaThumbsDown, FaThumbsUp } from 'react-icons/fa'; <FaThumbsDown size={30} style={{ fill: 'black' }} />

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests