unocss-ui

A Vue3 component library built with Unocss.
2,040 218
Install
npm install unocss-ui
Latest Version:0.0.3-alpha.4
License:MIT
Last Updated:Nov 12, 2024
Links: GitHub  ·  npm
Maintainer: cherryful

unocss-ui

This is a Vue3 component library based on Unocss. Its simplicity is its biggest feature, as almost all components rely only on a single .vue file, without depending on too much other code.

⚠️ This component library is still under construction and is currently only suitable for learning purposes.

Usage

pnpm add unocss unocss-ui @unocss/reset

Add unocss-ui in your main entry file.

import '@unocss/reset/tailwind.css'
import 'unocss-ui/style.css'
import 'uno.css'

import unocssui from 'unocss-ui'
import { createApp } from 'vue'
import App from './App.vue'

createApp(App).use(unocssui).mount('#app')

Customization

You can customize the theme of the component library by passing in the theme option.

Currently, only customization of colors is supported, and you must use the colors of the palette.

// uno.config.ts
import { defineConfig, presetUno } from 'unocss'
import { colors } from 'unocss/preset-mini'

import { presetUnocssUI } from 'unocss-ui'

export default defineConfig({
  theme: {
    colors: {
      primary: colors.red,
      secondary: colors.orange,
      accent: colors.yellow,
      success: colors.green,
      info: colors.blue,
      warning: colors.indigo,
      error: colors.violet,
    },
  },
  presets: [
    presetUno(),
    presetUnocssUI(),
  ],
})

Development

git clone https://github.com/cherryful/unocss-ui
cd unocss-ui
pnpm install

Develop and preview components.

pnpm dev:example

Related Packages

@una-ui/extractor-vue-script-edge

Unocss extractor for Vue script

31,160 679
@una-ui/extractor-vue-script

Unocss extractor for Vue script

21,050 680
unocss-preset-fluid

A fluid preset for unocss

11,896 48
@unocss/nuxt

Nuxt module for UnoCSS

3,181,743 18,982
unocss-preset-formkit

A UnoCSS preset for FormKit variants.

31,951

Version History

Pre-releases (21)
Version Released Vue License
0.0.3-alpha.4 MIT
0.0.3-alpha.3 MIT
0.0.3-alpha.2 MIT
0.0.3-alpha.1 MIT
0.0.2-alpha.9 MIT