Naive UI

Plausible is a lightweight and open-source Google Analytics alternative. Your website data is 100% yours and the privacy of your visitors is respected.

alt text

Plausible integration for Nuxt

Version Downloads License Github Stars Discord Discord

Setup

pnpm
pnpm add @huntersofbook/naive-ui-nuxt
yarn
yarn add @huntersofbook/naive-ui-nuxt
npm
npm add @huntersofbook/naive-ui-nuxt

Nuxt Config

export default defineNuxtConfig({
  modules: [
    '@huntersofbook/naive-ui-nuxt'
  ],
  // Optionally, specify global naive-ui config
  // Supports options that are normally set via 'n-config-provider'
  // https://www.naiveui.com/en-US/os-theme/docs/customize-theme
  naiveUI: {
    themeOverrides: {
      common: {
        primaryColor: '#ff0000',
        primaryColorHover: '#8b0000'
      }
    }
  }
})

Composables

app.vue
<script setup lang="ts">
import { darkTheme } from 'naive-ui'
</script>

<template>
  <NConfigProvider :theme="darkTheme">
    <NGlobalStyle />
    <div>
      Nuxt module playground!
      <NButton>Default</NButton>
    </div>
  </NConfigProvider>
</template>

Development ๐Ÿ’ป

  • Clone this repository
  • Enable Corepack using corepack enable (use npm i -g corepack for Node.js < 16.10)
  • Install dependencies using pnpm install
  • Stub module with pnpm dev:prepare
  • Run pnpm dev to start playground in development mode

License

MIT License ยฉ 2022-PRESENT productdevbook

Thanks

Thanks to @07akioni, this project is heavily inspired by naive-ui-nuxt-demo.

Thanks to @tobiasdiez, this project is inspired by some code structure.

๐Ÿ’š Credits

Nuxt 3 Plugin danielroe