Skip to content
Prev Previous commit
Next Next commit
update readme
  • Loading branch information
siriwatknp committed Feb 28, 2024
commit 9049ea0416e0d734f8edd702c77cd1080ef97c89
35 changes: 19 additions & 16 deletions packages/zero-runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

A zero-runtime CSS-in-JS library that extracts the colocated styles to their own CSS files at build-time.

- [Starter template](#starter-template)
- [Getting started](#getting-started)
- [Next.js](#nextjs)
- [Vite](#vite)
Expand All @@ -22,29 +21,22 @@ A zero-runtime CSS-in-JS library that extracts the colocated styles to their own
- [How-to guides](#how-to-guides)
- [Coming from Emotion or styled-components](#coming-from-emotion-or-styled-components)

## Starter template
## Getting started

Use the following commands to create a new project with the latest framework version and zero-runtime (for existing projects, see [Getting started](#getting-started)):
Zero-runtime supports Next.js and Vite with future support for more bundlers. You must install the corresponding plugin, as shown below.

**Next.js template**:
### Next.js

```bash
curl https://codeload.github.com/mui/material-ui/tar.gz/master | tar -xz --strip=2 material-ui-master/examples/zero-nextjs
cd zero-nextjs
```
#### Starter template

**Vite template**:
Use the following commands to create a new Next.js project with Zero Runtime setup:

```bash
curl https://codeload.github.com/mui/material-ui/tar.gz/master | tar -xz --strip=2 material-ui-master/examples/zero-vite
cd zero-vite
curl https://codeload.github.com/mui/material-ui/tar.gz/master | tar -xz --strip=2 material-ui-master/examples/zero-nextjs
cd zero-nextjs
```

## Getting started

Zero-runtime supports Next.js and Vite with future support for more bundlers. You must install the corresponding plugin, as shown below.

### Next.js
#### Manual installation

```bash
npm install @mui/zero-runtime
Expand All @@ -63,6 +55,17 @@ module.exports = withZeroPlugin({

### Vite

#### Starter template

Use the following commands to create a new Vite project with Zero Runtime setup:

```bash
curl https://codeload.github.com/mui/material-ui/tar.gz/master | tar -xz --strip=2 material-ui-master/examples/zero-vite
cd zero-vite
```

#### Manual installation

```bash
npm install @mui/zero-runtime
npm install --save-dev @mui/zero-vite-plugin
Expand Down