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

87
Views
Check multiple props with Styled-Components

With styled-components, I am able to check if a boolean prop is true, then add css like below:

const Box = styled.div`
  ${({ someProp }) =>
    someProp &&
    css`
      border: none;
  `};
`

But what if I want to check multiple conditions? For instance, I want to check if someProp is true AND someOtherProp is false, how would I go about doing that?

I'm thinking doing something like this but syntax does not appear to be correct:

const Box = styled.div`
  ${({ someProp, someOtherProp }) =>
    someProp && !someOtherProp
    css`
      border: 1px solid red;
  `};
`
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

const Box = styled.div`
  ${({ someProp, someOtherProp }) =>
    someProp && !someOtherProp &&
    css`
      border: 1px solid red;
  `};

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!