Vue 3 component library built with Tailwind CSS.
npm install @m0-foundation/ui-libraryThis library requires vue-router to be installed in your project:
pnpm add vue-router
# or
yarn add vue-router
# or
npm install vue-routerThis library requires Tailwind CSS to be installed and configured in your project.
-
Install Tailwind CSS:
pnpm add -D tailwindcss postcss autoprefixer npx tailwindcss init -p
-
In your
tailwind.config.js:const m0Preset = require('@m0-foundation/ui-library/tailwind.preset') module.exports = { presets: [m0Preset], // Your custom configuration theme: { extend: { // Override default colors if needed colors: { primary: colors.blue, // or any other color secondary: colors.gray, } } } }
-
Install Tailwind module:
pnpm add -D @nuxtjs/tailwindcss
-
In your
nuxt.config.ts:export default defineNuxtConfig({ modules: ['@nuxtjs/tailwindcss'], tailwindcss: { config: { presets: [require('@m0-foundation/ui-library/tailwind.preset')], // ...your config } } })
See the Tailwind CSS docs for more details.
import { createApp } from 'vue'
import M0UI from '@m0-foundation/ui-library'
import App from './App.vue'
const app = createApp(App)
app.use(M0UI)
app.mount('#app')<script setup>
import { MHeader, MFooter } from '@m0-foundation/ui-library'
</script>
<template>
<MHeader>
<template #logo>
<img src="logo.png" alt="Logo" />
</template>
<template #nav>
<a href="/">Home</a>
<a href="/about">About</a>
</template>
</MHeader>
<main>
<!-- Your content -->
</main>
<MFooter>
<template #column1>
<h3>Custom Column 1</h3>
<p>Custom content</p>
</template>
</MFooter>
</template># Install dependencies
npm install
# Start development server
npm run dev
# Build library
npm run buildMIT