mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
9986e82263
- Remove `experimental_` import for `useFormStatus` - Update all dependencies - Move to `postgres` so it works with any Postgres provider - Fix a TypeScript issue - Use `next dev --turbo`
26 lines
1.0 KiB
Markdown
26 lines
1.0 KiB
Markdown
# Forms with Next.js and Server Actions
|
|
|
|
This example shows how you can build forms with Next.js and Server Actions.
|
|
|
|
## Deploy your own
|
|
|
|
[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/next.js/tree/canary/examples/next-forms&project-name=next-forms&repository-name=next-forms&stores=%5B%7B%22type%22%3A%22postgres%22%7D%5D)
|
|
|
|
## How to use
|
|
|
|
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example:
|
|
|
|
```bash
|
|
npx create-next-app --example next-forms next-forms-app
|
|
```
|
|
|
|
```bash
|
|
yarn create next-app --example next-forms next-forms-app
|
|
```
|
|
|
|
```bash
|
|
pnpm create next-app --example next-forms next-forms-app
|
|
```
|
|
|
|
Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
|