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

237
Views
How to change text color in a Button?

I was wondering if it is possible to change the color of the text in Antd. For instance, I'd like this button to have the color of the text black#000000 and the icon DownloadOutlined in purple #5e46a1

My code

const App = () => {
  return (
      <Button type="primary">
        <DownloadOutlined/>
        My Button
      </Button>
  );
};

Have not been able to find the correct CSS attributes to inject in style inside DownloadOutlined

Thanks

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

0

const App = () => {
  return (
    <Button>
      <DownloadOutlined style={{color:"purple"}}/>
      <span style={{ color: "black" }}>My Button</span>
    </Button>
  );
};
about 4 years ago · Juan Pablo Isaza Report

0

Your html code would become:

const App = () => {
  return (
      <Button type="primary" className="custom_btn">
        <DownloadOutlined className="custom_btn_icon"/>
        My Button
      </Button>
  );
};

and your css code would be:

.custom_btn {
  color: #00000 !important; 
}
.custom_btn_icon {
  color: #5e46a1 !important; 
}

Don't forget to use !important to override default antd's styling.

about 4 years ago · Juan Pablo Isaza Report

0

Try this:

const App = () => {
  return (
      <Button type="primary" style={{color: "black"}}>
        <DownloadOutlined style={{color: "purple"}} />
        My Button
      </Button>
  );
};
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!