Styled Components
Styled Components is a CSS-in-JS library for React; I know it and can maintain projects that use it, while for new ones I choose Tailwind CSS.
How I use Styled Components
Styles are written in JavaScript next to the component and apply only to it.
If your project already uses Styled Components, there's no need to rewrite it: I can extend and fix it in the same style. If we agree to move to Tailwind CSS, I do it gradually, component by component, while the site keeps running.
In practice I use props for styles that depend on state, a theme that keeps colors and spacing in one place, and global styles for the base. I also know the trade-offs: styles are computed in the browser at runtime, and in the Next.js App Router such components have to be client components. I don't have a portfolio project built on it, so I count it among the tools I use less often.
For new projects I choose Tailwind CSS, with ShadCN UI for ready-made components, because it adds no JavaScript for styling and stays easy to maintain.
Frequently asked questions about Styled Components
What is Styled Components?
Styled Components is a React library where you write CSS inside JavaScript, right next to the component. Each component gets its own unique class names, so styles don't clash, and they can change based on props.
Styled Components or Tailwind CSS: which is better?
It depends on the project, but for new projects I choose Tailwind CSS. Tailwind produces plain CSS at build time and adds no JavaScript for styling, while Styled Components computes styles in the browser, which is handy for dynamic themes but fits less well with React Server Components.
Do you maintain projects that use Styled Components?
Yes, I know Styled Components and can extend and maintain a project that already uses it, without a rewrite. I don't have a portfolio project built on it, and for new projects I choose Tailwind CSS.