Skip to content

Commit

Permalink
feat: starter example (#2913)
Browse files Browse the repository at this point in the history
* feat: add starter example

* fix: (starter-example) remove jotai reference

* fix: small refinements

* fix: format code

---------

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
  • Loading branch information
leweyse and dai-shi authored Dec 28, 2024
1 parent 5d92ad2 commit ebf2b7a
Show file tree
Hide file tree
Showing 10 changed files with 1,003 additions and 0 deletions.
20 changes: 20 additions & 0 deletions examples/starter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Starter [![Open in StackBlitz](https://img.shields.io/badge/Open%20in-StackBlitz-blue?style=flat-square&logo=stackblitz)](https://stackblitz.com/github/pmndrs/zustand/tree/main/examples/starter)

## Set up locally

```bash
git clone https://github.com/pmndrs/zustand

# install project dependencies & build the library
cd zustand && pnpm install

# move to the examples folder & install dependencies
cd examples/starter && pnpm install

# start the dev server
pnpm dev
```

## Set up on `StackBlitz`

Link: https://stackblitz.com/github/pmndrs/zustand/tree/main/examples/starter
15 changes: 15 additions & 0 deletions examples/starter/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="zustand examples" />
<title>Zustand Examples | Starter</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
23 changes: 23 additions & 0 deletions examples/starter/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "starter",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"zustand": "^5.0.2",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"typescript": "^5.0.0",
"vite": "^5.3.4"
}
}
Loading

0 comments on commit ebf2b7a

Please sign in to comment.