https://github.com/vinayakkulkarni/v-spotlight
๐ฆ Tiny reusable spotlight component for your Vue App
https://github.com/vinayakkulkarni/v-spotlight
spotlight ui ux v-spotlight vue vue-component vue-plugin vue2 vuejs vuejs2
Last synced: 2 months ago
JSON representation
๐ฆ Tiny reusable spotlight component for your Vue App
- Host: GitHub
- URL: https://github.com/vinayakkulkarni/v-spotlight
- Owner: vinayakkulkarni
- License: mit
- Created: 2018-05-26T16:10:09.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2025-03-18T19:48:53.000Z (3 months ago)
- Last Synced: 2025-03-20T23:41:49.323Z (3 months ago)
- Topics: spotlight, ui, ux, v-spotlight, vue, vue-component, vue-plugin, vue2, vuejs, vuejs2
- Language: Vue
- Homepage: http://v-spotlight.netlify.app/
- Size: 2.75 MB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# V-Spotlight ๐ก
* ๐ฆ Tiny reusable Spotlight component for your Vue App
## Table of Contents
- [V-Spotlight ๐ก](#v-spotlight-)
- [Table of Contents](#table-of-contents)
- [Demo](#demo)
- [Requirements](#requirements)
- [Installation](#installation)
- [Build Setup](#build-setup)
- [Usage](#usage)
- [Example](#example)
- [Contributing](#contributing)
- [Author](#author)## Demo
[](https://stackblitz.com/edit/v-spotlight?file=src/App.vue)
## Requirements
- [vue](https://vuejs.org/) `^3.x`
### Installation
```sh
npm install --save v-spotlight
```CDN: [UNPKG](https://unpkg.com/v-spotlight/dist/) | [jsDelivr](https://cdn.jsdelivr.net/npm/v-spotlight/dist/) (available as `window.VSpotlight`)
### Build Setup
```bash
# install dependencies
$ npm install# package the library
$ npm run build
```### Usage
Global component:
```js
// main.ts
import { VSpotlight } from 'v-spotlight';
import { createApp } from 'vue';const app = createApp({});
app.component('VSpotlight', VSpotlight);
```Or use locally
```js
// component.vueimport { defineComponent } from 'vue';
import { VSpotlight } from 'v-spotlight';export default defineComponent({
components: {
VSpotlight,
},
});```
For Nuxt 3, create a file in `plugins/v-spotlight.ts`
```js
import { VSpotlight } from 'v-spotlight';export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.component('VSpotlight', VSpotlight);
});
```then import the file in `nuxt.config.{j|t}s`:
```js
export default {
// ...
plugins: [
// ...
{ src: '~/plugins/v-spotlight', mode: 'client' },
// ...
],
// ...
};
```### Example
```html
import { defineComponent, ref } from 'vue';
import type { Ref } from 'vue';
import { VSpotlight } from 'v-spotlight';export default defineComponent({
components: {
VSpotlight,
},
});@import 'v-spotlight/dist/v-spotlight.css';
```
## Contributing
1. Fork it ( [https://github.com/vinayakkulkarni/v-spotlight/fork](https://github.com/vinayakkulkarni/v-spotlight/fork) )
2. Create your feature branch (`git checkout -b feat/new-feature`)
3. Commit your changes (`git commit -Sam 'feat: add feature'`)
4. Push to the branch (`git push origin feat/new-feature`)
5. Create a new [Pull Request](https://github.com/vinayakkulkarni/v-spotlight/compare)_Note_:
1. Please contribute using [GitHub Flow](https://web.archive.org/web/20191104103724/https://guides.github.com/introduction/flow/)
2. Commits & PRs will be allowed only if the commit messages & PR titles follow the [conventional commit standard](https://www.conventionalcommits.org/), _read more about it [here](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum)_
3. PS. Ensure your commits are signed. _[Read why](https://withblue.ink/2020/05/17/how-and-why-to-sign-git-commits.html)_## Author
**v-spotlight** ยฉ [Vinayak](https://vinayakkulkarni.dev), Released under the [MIT](./LICENSE) License.
Authored and maintained by Vinayak Kulkarni with help from contributors ([list](https://github.com/vinayakkulkarni/v-spotlight/contributors)).> [vinayakkulkarni.dev](https://vinayakkulkarni.dev) ยท GitHub [@vinayakkulkarni](https://github.com/vinayakkulkarni) ยท Twitter [@\_vinayak_k](https://twitter.com/_vinayak_k)