---
url: "https://vueda.dev/v3/reference/api/js/use/useMaska/functions/useMaska.md"
title: "useMaska"
---

# useMaska

## Overview

Applies a maska input mask to an element ref with reactive options. When called
inside a component setup, initializes on mount and cleans up on unmount. When
called outside a component context, initializes immediately. Cleanup is tied to
the enclosing effect scope via tryOnScopeDispose, so it works in components,
watchEffect, and manual effectScope contexts. The destroy() method is also
exposed for early teardown and is idempotent.

## Signature

`useMaska(target, options)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-target">target</span> | `Ref` | yes | A template ref pointing to an input element or component with an input `$el`. |
| <span id="param-options">options</span> | `MaybeRefOrGetter` | yes | Mask configuration object. May be a ref or getter for reactive updates. |

### Returns

[UseMaskaReturn](/v3/reference/api/js/use/useMaska/types/UseMaskaReturn.md)

## Source

`client/lib/use/useMaska.js:43`
