A customizable animated cursor for Angular applications. Enhance user experience with a stylish and interactive cursor effect.
Install the package using npm:
npm install afnaan-ngx-custom-cursor
Since this is a standalone component, import it directly in your Angular component:
import { Component } from '@angular/core';
import { AfnaanNgxCustomCursorComponent } from 'afnaan-ngx-custom-cursor';
@Component({
selector: 'app-root',
standalone: true,
imports: [AfnaanNgxCustomCursorComponent],
templateUrl: './app.component.html',
styleUrl: './app.component.scss'
})
export class AppComponent {
title = 'My Angular App';
}
<lib-afnaan-ngx-custom-cursor></lib-afnaan-ngx-custom-cursor>
<router-outlet></router-outlet>
Pass a custom cursor image as an input:
<lib-afnaan-ngx-custom-cursor cursorImage="https://your-image-url.com/cursor.png"></lib-afnaan-ngx-custom-cursor>
By default, the cursor size is 32px. You can change its size using CSS or SCSS:
lib-afnaan-ngx-custom-cursor #cursor {
width: 16px !important; /* Adjust size */
height: 16px !important;
}
lib-afnaan-ngx-custom-cursor #cursor img {
width: 100% !important;
height: 100% !important;
}
::ng-deep lib-afnaan-ngx-custom-cursor #cursor {
width: 16px !important;
height: 16px !important;
}
::ng-deep lib-afnaan-ngx-custom-cursor #cursor img {
width: 100% !important;
height: 100% !important;
}
ng serve
Then, open your browser and navigate to: http://localhost:4200/
ng build
The build artifacts will be stored in the dist/
directory.
ng test
ng e2e
This project is licensed under the MIT License.
💡 Created by Afnaan Ullah 🚀