Chakra UI Module for Nuxt.js
- Add
@chakra-ui/nuxt
dependency to your project
yarn add @chakra-ui/nuxt @nuxtjs/emotion
- Add
@chakra-ui/nuxt
&@nuxtjs/emotion
to themodules
section ofnuxt.config.js
// nuxt.config.js
export default {
modules: [
'@chakra-ui/nuxt',
'@nuxtjs/emotion'
],
/**
* Add extend the plugin options under the `chakra` key.
**/
chakra: {
extendTheme: {
colors: {
brand: { /* ... */ }
}
}
}
}
- Wrap your default layout in
layouts/
directory inside CThemeProvider as seen in the Chakra UI docs to start consuming Chakra Components. Like so:
<template>
<c-theme-provider>
<c-reset/>
<nuxt/>
</c-theme-provider>
</template>
<script>
import {
CThemeProvider,
CReset,
CButton
} from "@chakra-ui/vue";
export default {
name: 'DefaultLayout',
components: {
CThemeProvider,
CReset,
}
};
</script>
- Clone this repository
- Install dependencies using
yarn bootstrap
- Start development server using
yarn dev
Copyright (c) Kelvin Omereshone kelvinomereshone@gmail.com