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

179
Views
Changing css in react-select component

I have below select component in my react. I need to modify this component.

so I am using below code for it.

 const customStyles = {
        option: (provided:any, state:any) => ({
          ...provided,
          margin:'10px',
        }),
        control: (provided:any) => ({
          ...provided,
          height: '48px !important',
          'line-height': '2rem center',
          border: '#e6e6e6 solid 5px !important',
        }),
        input:(provided:any)=>({
            ...provided,
            'margin-top':'-25px',
        })
      }

 

below is select component.

  <Select
          id="sponsor" 
          name="sponsor"   
         placeholder={sponsor}
         styles={customStyles}
          options={result.map((sponsor:Sponsor)=>
                ({ label: sponsor.name, value: sponsor.id })
      )}
      >

actually seniors are not allowing to write css in react jsx file. is there anyway I can convert this customStyles code to css format? I tried a lot but its not easy to modify css for react-select component.

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

0

const customStyles = { option: (provided:any, state:any) => ({ ...provided, margin:'10px', }), control: (provided:any) => ({ ...provided, height: '48px !important', 'line-height': '2rem center', border: '#e6e6e6 solid 5px !important', }), input:(provided:any)=>({ ...provided, 'margin-top':'-25px', }) }strong text

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!