An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

        

# V-Spotlight ๐Ÿ’ก


npm


GitHub release (latest by date including pre-releases)


CI Status


DeepScan grade


npm





GitHub last commit


GitHub contributors

* ๐Ÿ”ฆ 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

[![Edit v-spotlight demo](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](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.vue

import { 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)