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

228
Views
Where to put styled components styles

components for styling my react app, so far i had a separate folder in each page's folder called Styles and stored my styled component wrappers inside it( e.g. ThemeToggler.Style.js or Section.Style.js and ... ).

But i realized that my code is getting messy and project files count increases so fast because creating a component means creating 2 files, also some styles was so simple and small that i decided to write them inside the component's main file, because its more readable.

But i still feel that this approach is not good too because some styles are too long to put them inside the component's file , also some styles are not about the component it self, maybe i have a style for showing the adjacent nav of this div if user clicks on it. I thought that i'll put them inside a separate file called DivOnHover.js but it seems not correct :)

I'll like to hear your approach for managing styled-components styles, how do you store them in your folder structure ?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Personally I tend to use this structure pretty often:

components/
| Button/
| | Button.js
| | Button.styles.js
| Navbar/
| | Navbar.js
| | Navbar.styles.js

At the cost of making more files, it allows you to separate your component logic and styles.

over 4 years ago · Santiago Trujillo Report

0

My Folder Structure would be like this

/app
  /pages ( React Router )
  /styles ( CSS only )
  /components ( Reusable Components )
  /styled ( Styled Components )
  /hooks ( React Hooks )
  index.js
  app.js
  routes.js ( React Router )
over 4 years ago · Santiago Trujillo 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!