More Premium Hugo Themes Premium Vue Themes

Maska

Simple zero-dependency input mask for Vue, Svelte, Alpine.js and vanilla JS.

Maska

Simple zero-dependency input mask for Vue, Svelte, Alpine.js and vanilla JS.

Author Avatar Theme by beholdr
Github Stars Github Stars: 1901
Last Commit Last Commit: Mar 22, 2025 -
First Commit Created: Aug 27, 2024 -
default image

Overview

Maska is a lightweight library designed for input masking and formatting. It offers various features like no dependencies, support for different frameworks like Vue, Alpine.js, and Svelte, custom tokens with modifiers, dynamic masks, and more. In version 3, Maska introduces integrations with Alpine.js and Svelte, a number mask mode, and simplified directive format among other improvements.

Features

  • No dependencies and small size: ~3 Kb gziped
  • Works with Vanilla JS version + Vue 2/3, Alpine.js and Svelte integrations
  • Custom tokens with modifiers, transform functions and hooks
  • Number mask mode for easy money formatting
  • Dynamic, reversed, and eager masks
  • Integrations with Alpine.js and Svelte in version 3
  • Simplified directive format
  • Other small improvements and fixes

Installation

To install Maska, you can use npm with the following command:

npm install maska

Or you can include the script directly in your HTML file from a CDN:

<script src="https://cdn.jsdelivr.net/npm/maska/dist/maska.umd.min.js"></script>

Check the official documentation for more detailed installation instructions.

Summary

Maska is a versatile input masking library with a small footprint and support for popular frameworks like Vue, Alpine.js, and Svelte. It offers various features like custom tokens, number mask mode, and dynamic masks. Version 3 brings integrations with Alpine.js and Svelte, a simplified directive format, and other improvements, making it a convenient tool for input formatting in web development.