vue-gooey-cursor
Version:
Gooey Cursor Component for Vue 3
93 lines (67 loc) • 1.43 kB
Markdown
for Vue 3.
```sh
npm i vue-gooey-cursor
```
```js
import GooeyCursor from 'vue-gooey-cursor'
// register globally
app.component('GooeyCursor', GooeyCursor)
// or locally
export default {
components: { GooeyCursor },
// ...
}
```
```html
<!-- simple -->
<GooeyCursor />
<!-- with default props -->
<GooeyCursor color="#42b883" :size="32" :length="8" hover="a, button" />
```
- _Optional_
- Type: `String`
- color of the cursor, any format accepted by css will work
- _Optional_
- Type: `Number`
- width and height of the cursor in px
- _Optional_
- Type: `Number`
- number of dots forming the tail of the cursor
- _Optional_
- Type: `String`
- selector string, cursor will grow and turn transparent while hoverind on these elements
For the cursor to work correctly, please apply these base styles to your page:
```css
body {
min-width: 100vw;
min-height: 100vh;
overflow: hidden;
}
html {
cursor: none;
}
a {
cursor: none;
}
button {
cursor: none;
}
```
Some css properties can be easily changed by setting css variables.
```css
.gooey-cursor {
--z-index: 1000; /* default: 9999 */
--color: orange; /* default: #42b883 */
}
```
Gooey Cursor Component