Overview
Unocss-ui is a Vue3 component library based on the UnoCss framework. Its biggest feature is its simplicity, with most components relying only on a single .vue file without depending on additional code. However, it is important to note that this component library is still under construction and is currently only suitable for learning purposes.
Features
- Simplistic design: All components rely on a single .vue file, making them easy to understand and use.
- Customizable theme: The component library allows you to customize the theme by passing in the theme option, supporting color customization using the palette colors.
- Development-friendly: The project structure includes separate modules for development and preview, making it convenient for developers to work on and test components.
Installation
To use Unocss-ui in your Vue3 project, follow these steps:
- Install the library using npm or yarn:
npm install unocss-ui
or
yarn add unocss-ui
- Import and use the components in your project:
import { Button, Card, Input } from 'unocss-ui';
...
export default {
components: {
Button,
Card,
Input
},
...
}
- Customize the theme by passing in the theme option when importing the library:
import { createApp } from 'vue';
import unocssUi from 'unocss-ui';
const app = createApp(App);
app.use(unocssUi, {
theme: {
colors: {
primary: '#ff0000',
secondary: '#00ff00',
...
}
}
});
app.mount('#app');
Summary
Unocss-ui is a Vue3 component library that brings simplicity and ease of use to developers. Its reliance on single .vue files for components makes it lightweight and intuitive. Although it is still in development and intended for learning purposes only, it provides a customizable theme option and a convenient project structure for developers to work with.