Skip to content

docs: using nuxt with Chakra UI Vue #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/1.getting-started/1.installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version: 2.0+
Let's see how you can get started with **Chakra UI Vue** 🥳.

You will start from a [Vue 3](https://vuejs.org/) project. Don't worry, this can be a new or existing project.
If you are looking to install `Chakra UI Vue` in [Nuxt 3](https://nuxt.com/), you can take a look [here](../2.frameworks/0.index.md).
If you are looking to install `Chakra UI Vue` in [Nuxt 3](https://nuxt.com/), you can take a look [here](./2.nuxt.md).

The first thing you will need to do is install the `Chakra UI Vue` package and its dependencies in the Vue project.
This can be achieved with the following terminal command:
Expand Down
54 changes: 54 additions & 0 deletions content/1.getting-started/2.nuxt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Using Nuxt
description: How to use Chakra UI Vue with Nuxt
version: 2.0+
---
# Chakra UI Nuxt

💚 We all love [Nuxt 3](https://nuxt.com/) 3! Getting started with Chakra UI Nuxt is also just as simple.

## Installation

If you wish to use Chakra UI Vue with Nuxt, you will have to install the `@Chakra-ui/nuxt-next` package. This package will install all the required dependencies.

```bash
pnpm install @chakra-ui/nuxt-next
```

or

```bash
yarn add @chakra-ui/nuxt-next
```

### Registering the Chakra module

We then register the Chakra UI module in the `modules` key of our `nuxt.config.ts`. [See the Nuxt documentation to learn more about modules in Nuxt.js](https://nuxt.com/docs/api/configuration/nuxt-config#modules)

Chakra module options are the same as the Vue CLI plugin options. Learn more about the [Chakra plugin options here](./plugin-options).

```tsx
//nuxt.config.ts
export default {
modules: [
'@chakra-ui/nuxt-next',
],
/**
* Add extend the plugin options under the `chakra` key.
**/
chakra: {
extendTheme: {
colors: {
brand: { /* ... */ }
}
}
}
}
```

That is it! 🚀
You can now use the Chakra UI components and features in your Nuxt application.

### Starters

Here is a Nuxt 3 Github repo that contains a starter for Chakra UI Nuxt: [https://github.com/codebender828/chakra-nuxt-v1-demo](https://github.com/codebender828/chakra-nuxt-v1-demo).
12 changes: 0 additions & 12 deletions content/2.frameworks/0.index.md

This file was deleted.

8 changes: 0 additions & 8 deletions content/2.frameworks/1.nuxt-3.md

This file was deleted.

1 change: 0 additions & 1 deletion content/2.frameworks/_dir.yml

This file was deleted.

File renamed without changes.