---
title: Cursor Tracker
description: A wrapper component that tracks the cursor moving within it
author: harimanok_
labels: ["requires interaction", "hover"]
---

<ComponentPreview name="container-cursor-tracker--docs" />

## Installation

<Steps>
<Step>Copy `useMousePosition` hook</Step>
```ts file=<rootDir>/hooks/use-mouse-position.ts
```

<Step>Run the following command</Step>

It will create a new file `cursor-tracker.tsx` inside the `components/animata/container` directory.

```bash
mkdir -p components/animata/container && touch components/animata/container/cursor-tracker.tsx
```

<Step>Paste the code</Step>{" "}

Open the newly created file and paste the following code:

```jsx file=<rootDir>/animata/container/cursor-tracker.tsx

```

</Steps>

## Credits

Built by [hari](https://github.com/hari)
