Vuestic UI Framework
Vuestic UI is a comprehensive, open-source Vue 3 UI framework developed by Epicmax, currently in its 1.x stable release series, with version 1.10.3 being recent. It provides over 60 customizable, production-ready components designed for rapid development of responsive, accessible, and high-quality web applications. Key differentiators include robust global and local configuration options for deep customization, built-in i18n integration, and full TypeScript support, ensuring strong type inference and developer-friendly IntelliSense. The library maintains a steady release cadence with frequent updates focusing on features, fixes, and performance enhancements. It leverages modern CSS practices like BEM naming conventions to minimize style conflicts, allowing seamless integration with other libraries like Tailwind CSS.
Common errors
-
Error: Vuestic cache plugin is not registered!
cause The Vuestic UI plugin was not correctly installed or initialized in the application's entry file, or a build cache issue exists.fixEnsure `app.use(createVuestic())` is in `main.ts` (or `main.js`). Clear `node_modules/.vite/deps/` (for Vite) or `node_modules/.nuxt/` (for Nuxt) and `npm install` again. -
Component styles are not applying or conflict with existing CSS.
cause Incorrect CSS import path, especially when mixing Vuestic UI with other frameworks like Tailwind, or general CSS specificity issues.fixFor Tailwind projects, import `vuestic-ui/styles/essential.css` and `vuestic-ui/styles/typography.css` instead of `vuestic-ui/css`. For other conflicts, inspect generated CSS using developer tools and override specific Vuestic CSS variables (prefixed with `--va-`) for targeted adjustments. -
Cannot access 'composableName' before initialization (e.g., 'Cannot access 'useColors' before initialization')
cause A Vuestic UI composable (e.g., `useColors`, `useModal`) is being called outside of a Vue component's `setup` function or a valid lifecycle hook, leading to an invalid reactive context.fixEnsure Vuestic UI composables are called within the `setup` block of a Vue component (or `<script setup>`) or a function invoked by a lifecycle hook. They rely on Vue's component instance context to function correctly.
Warnings
- gotcha The 'Vuestic cache plugin is not registered!' error often occurs due to incorrect Vuestic UI plugin installation, particularly when using a custom build setup or after package updates. It can also stem from import issues where the plugin isn't properly initialized before components are used.
- gotcha When integrating with Tailwind CSS, importing the default `vuestic-ui/css` can lead to style conflicts because Vuestic's reset styles might clash with Tailwind's.
- deprecated The Web Components build feature in Vuestic UI is currently in 'test mode'. This means its API might change in future releases, and unexpected bugs could occur. Production use should be approached with caution.
- gotcha Globally overriding component props or styles via `createVuestic` can have unintended, widespread effects across your application. While powerful for consistent theming, it can make debugging specific component behavior challenging if not carefully managed.
Install
-
npm install vuestic-ui -
yarn add vuestic-ui -
pnpm add vuestic-ui
Imports
- createVuestic
import VuesticUI from 'vuestic-ui'; // VuesticUI is not a default export app.use(VuesticUI);
import { createApp } from 'vue'; import { createVuestic } from 'vuestic-ui'; import 'vuestic-ui/css'; const app = createApp(App); app.use(createVuestic({ /* global config */ })); - VaButton
import { VaButton } from 'vuestic-ui'; - useColors
import { useColors } from 'vuestic-ui/dist/composables/useColors'; // Correct path, but direct import is cleanerimport { useColors } from 'vuestic-ui'; const { getColor, getTextColor } = useColors();
Quickstart
import { createApp } from 'vue';
import App from './App.vue';
import { createVuestic, VaButton } from 'vuestic-ui';
import 'vuestic-ui/css';
const app = createApp(App);
// Install Vuestic UI plugin with optional global configuration
app.use(createVuestic({
colors: {
// Define custom color palette
primary: '#4ae387',
success: '#40e583',
danger: '#e34a4a'
},
components: {
VaButton: {
// Globally configure VaButton props
size: 'medium',
preset: 'primary'
}
}
}));
app.mount('#app');
// App.vue example:
// <template>
// <div>
// <h1>Welcome to Vuestic UI</h1>
// <VaButton>Click Me</VaButton>
// <VaButton color="success">Success Button</VaButton>
// </div>
// </template>
// <script setup>
// // No explicit import needed in <script setup> if globally registered
// </script>