Documentation about using Vike with styled-components.

💚
This page is maintained by the community and may contain outdated information; PR welcome to update or improve it.

If you are using vike-react you can use vike-react-styled-components for automatic integration.

The vike-react-styled-components extension requires vike-react.

Manual integration

When using styled-components, you need to collect the page's styles upon SSR:

You can follow along on this tutorial (vite-plugin-ssr was the previous name of Vike) on how to add styled-components to your Vike app.

If you use vike-react, you can manually integrate styled-components by using:

Examples:

See also