---
title: Mask Text
description: A cursor with a mask hover effect revealing the text
labels: ["requires interaction", "hover"]
author: morphhyy
---

<ComponentPreview name="text-mask-text--docs" />

## Installation

<Steps>

<Step>Create a hook `use-mouse-postition.ts` and paste the following code</Step>

```jsx file=<rootDir>/hooks/use-mouse-position.ts

```

<Step>Create a `circle.svg` file inside `public` directory and paste the following code</Step>

```jsx file=<rootDir>/public/circle.svg

```

<Step>Update `tailwind.config.js`</Step>
```js
theme: {
    extend: {
     colors: {
        foreground: "hsl(var(--foreground))",
     }
    },
  },
```

<Step>Run the following command</Step>

It will create a new file called `mask-text.tsx` inside the `components/animata/text` directory.

```bash
mkdir -p components/animata/text && touch components/animata/text/mask-text.tsx
```

<Step>Paste the code</Step>

Open the newly created file and paste the following code:

```jsx file=<rootDir>/animata/text/mask-text.tsx

```

</Steps>

## Credits

Built by [Bibek Bhattarai](https://github.com/morphhyy)
