You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 20, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: packages/chakra-ui-docs/docs/with-nuxt.mdx
+18-15Lines changed: 18 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -15,27 +15,30 @@ With Nuxt.js we need to install the [`@nuxtjs/emotion`](https://github.com/nuxt-
15
15
styles to be generated and injected in the server build.
16
16
17
17
```bash
18
-
yarn add @chakra-ui/vue emotion @nuxtjs/emotion
18
+
yarn add @chakra-ui/nuxt @nuxtjs/emotion
19
19
```
20
20
21
-
### Plugin setup
21
+
# Register Module
22
+
We then register the Chakra UI module in the `modules` key of our `nuxt.config.js`. [See the Nuxt documentation to learn mroe about modules in Nuxt.js](https://nuxtjs.org/guide/modules)
22
23
23
-
Create a file in your `plugins/` directory. For this example, we'll call it `chakra.js`. In here
24
-
we shall import Vue and register the plugin.
25
-
26
-
```js
27
-
// chakra.js
28
-
importVuefrom'vue'
29
-
importChakrafrom'@chakra-ui/vue'
30
-
31
-
Vue.use(Chakra)
32
-
```
33
-
34
-
We then add the Chakra plugin's file path in the `plugins` key of our `nuxt.config.js`. [See the Nuxt documentation to learn mroe about plugins in Nuxt.js](https://nuxtjs.org/guide/plugins)
24
+
Learn more about the [Chakra plugin options here](/plugin-options)
35
25
36
26
```js
37
27
exportdefault {
38
-
plugins: ['~/plugins/chakra']
28
+
modules: [
29
+
'@chakra-ui/nuxt',
30
+
'@nuxtjs/emotion'
31
+
],
32
+
/**
33
+
* Add extend the plugin options under the `chakra` key.
0 commit comments