@discue/ui-components
Version:
The themeable open source Vue.js UI component library of discue.io
75 lines (51 loc) โข 2.5 kB
Markdown
<p align="center"><a href="https://www.discue.io/" target="_blank" rel="noopener noreferrer"><img width="256" src="https://www.discue.io/icons-fire-no-badge-square/web/icon-192.png" alt="Vue logo"></a></p>
<br/>
<div align="center">
[](https://github.com/discue/ui-components/releases/)
[](https://www.npmjs.com/package/@discue/ui-components)
[](https://www.npmjs.com/package/@discue/ui-components)
<br/>
[](https://www.npmjs.com/package/@discue/ui-components)
[](https://www.npmjs.com/package/@discue/ui-components)
<br/>
[](/CONTRIBUTING.md "Go to contributions doc")
[](https://nodejs.org "Go to Node.js homepage")
</div>
<br/>
# ui-components
A collection of **themeable** vue.js components used in discue.io.
## ๐ฆ Installation
Install the package via npm:
```bash
npm install @discue/ui-components
```
## ๐ Usage
In your component files, import any ui component from the main export and use it in your template.
```vue
<template>
<NavLink href="#pricing">Go to pricing</NavLink>
</template>
<script setup>
import { NavLink } from '@discue/ui-components'
</script>
```
The list of currently available components can be found at [ui.discue.io](https://ui.discue.io/components/back-to-top.html).
## โจ Theming
To change the default theme, register the module as a [Vue Plugin](https://vuejs.org/guide/reusability/plugins.html#introduction) and pass an object with theme properties. Valid theme property keys can be found in [theme.js](src/theme.js) and [theme-keys.js](src/theme-keys.js).
```js
import { theme } from '@discue/ui-components'
import { createApp } from 'vue'
import App from './App.vue'
createApp(App)
.use(theme, {
[theme.TEXT_COLOR_DEFAULT]: 'text-gray-500'
})
.mount('#app')
```
## ๐งช Running Tests
To run tests, run the following command
```bash
npm run test:unit
```
## ๐ License
[MIT](https://choosealicense.com/licenses/mit/)