Documentation about using Vike with styled-jsx
.
💚 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-jsx
for automatic integration.
The vike-react-styled-jsx
extension requires vike-react
.
Manual integration
If you use vike-react
, you can manually integrate styled-jsx
by using:
Example:
Without vike-react
To use Vike with styled-jsx
without vike-react
:
-
Install:
-
Add styled-jsx
to vite.config.js
:
-
Collect and inject styles.
When using a CSS-in-JS tool, like styled-jsx
, you always need to collect the page's styles upon SSR in order to avoid FOUC.
Example:
See also