Actions
Mask
Description
The Mask action can be used to create input masks, it will automatically format the input value based on the provided mask. This action is heavily inspired by the Alpine.js Mask plugin.
Usage
<script lang="ts">
import { mask, type MaskParameters } from 'action-archive';
const maskParameters: MaskParameters = {
mask: '99/99/99'
};
</script>
<input use:mask={maskParameters} />
Wildcards
Masks can be specified through 3 types of wild cards, any other character will be treated as a literal.
Wildcard | Description |
---|---|
* | Any character [a-z0-9] |
9 | Any number [0-9] |
a | Any letter [a-z] |
Example
API
Parameters
Name | Type | Default | Description |
---|---|---|---|
mask | string | - | Mask that the input will adhere to. |
disabled | boolean | false | Disables the action. |