Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

268
Views
How to change the font size of Chip of Material-UI

I have Chip widget

const styles = {
  root:{
  },
  chip:{
    margin: "2px",
    padding: "2px"
  }
}

const SmartTagChip = (props) =>{
  const classes = useStyles();
  return(  
    <Chip style={{color:"white"}} clickable className={classes.chip}
    color="default" 
     label={item.label} variant="outlined"/>:
  )
}

I want to make font size bigger.

So I try but in vain.

<Chip style={{color:"white"}} clickable className={classes.chip}

I am reading document https://material-ui.com/api/chip/

and found some information about CSS

root    .MuiChip-root   Styles applied to the root element.

I guess I should customize .MuiChip-root class though,

How can I do this?

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

You can use built-in solution from Material-ui called withStyles. It allows to simply apply styles to components. In your case it will look like this:

const StyledChip = withStyles({
  root: {
    backgroundColor: 'red'// here you can do anything actually 
  },
  label: {
    textTransform: 'capitalize',
  },
})(Chip);

const SmartTagChip = (props) =>{
  const classes = useStyles();
  return(  
    <StyledChip clickable
    color="default" 
     label={item.label} variant="outlined"/>:
  )
}
about 4 years ago · Juan Pablo Isaza Report

0

You can create a style class for the chip and then access the label through a sub-selector.

export const useStyles = makeStyles(() => ({
    
myClassName: {
    borderRadius: '9px', //some style
    '& .MuiChip-label': { fontSize: 18 }, // sub-selector
  },

}));
about 4 years ago · Juan Pablo Isaza Report

0

To complete Sabrina's answer

import {makeStyles} from "@mui/styles";

    
const useStyles = makeStyles(() => ({
        chipCustom: {
            borderRadius: '9px', //some style
            '& .MuiChip-label': {fontSize: 18}, // sub-selector
        },
    }));
    
const customChipClass = useStyles();
    
<Chip className={customChipClass.chipCustom} label="Test"/>                                                                                                        
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!