JavaHava
JavaHava

Reputation: 189

How to change icon size?

I'm using primereact and according to there website this is how they change there icon size.

However this doesn't work in jsx as it won't let you directly reference style without it being an object.

Are there any workarounds to this?

EDIT: Code for Button where icon is nested in below:

<Button 
  label="" 
  icon="pi pi-cog"   
  className="cogIcon"  
  onClick={(e) => this.setState({visibleRight:true})} 
  style={{marginTop:'.25em', marginRight:'.25em'} } 
/> 

Upvotes: 1

Views: 1009

Answers (1)

Vencovsky
Vencovsky

Reputation: 31625

In the link you provide, they have an example

<i class="pi pi-check" style="font-size: 3em"></i>

Just add fontSize: 3em (or the size you want).

<Button 
  label="" 
  icon="pi pi-cog"   
  className="cogIcon"  
  onClick={(e) => this.setState({visibleRight:true})} 
  style={{marginTop:'.25em', marginRight:'.25em', fontSize: '3em'} } 
/> 

Upvotes: 1

Related Questions