Set up Master CSS in React
Guide to setting up Master CSS in your React project.
Master CSS Progressive Rendering scans the rendered HTML ahead of time, server-side or at build time, generates the corresponding CSS rules for each page, and lazy loads the runtime engine to keep track of the dynamic class names.
Faster page loading
Non-rendering-blocking internal CSS and lazy loading
Fully automatic
Capture any program-generated class names
CSS encapsulation
Only ship the page-used CSS instead of the whole site
Quick start
This is a simple Vite example of React server-side rendering.
A full-stack framework, such as Next.js, Remix, etc., is recommended for better application performance and experience.
Clone the example
Copy-paste the following commands to quickly start using the react.pr.beta.css.master.co.
npx degit master-co/css/examples/react-with-progressive-rendering my-projectcd my-projectnpm install @master/css.react@betanpm installnpm run dev
Are you building a React single-page application (SPA)? Use the handy Master CSS Runtime Rendering in React.