WebGPU shader effects packaged as drop-in components for React, Vue, Svelte, Solid and plain JavaScript.
beholdr/maska
Zero-dependency input mask library for Vue, Svelte, Alpine.js and vanilla JavaScript, about 3 KB gzipped.
- Stars
- 2,021
- Forks
- 78
- Open issues
- 6
- Last commit
- 23 days ago
What is it?
Maska formats text inputs as users type, applying patterns such as phone numbers, dates or card numbers. It has no runtime dependencies and ships as a small library usable from plain JavaScript or through integrations for Vue 2/3, Alpine.js and Svelte.
Masks can be built from custom tokens with modifiers, transform functions and hooks. It supports dynamic masks, reversed masks and eager masks that display the fixed characters before the user types. It works with both native inputs and custom input components.
A number mask mode covers money-style formatting. Version 3 added the Alpine.js and Svelte integrations, the number mask mode and a simplified directive format.
Key features
- 01Zero dependencies with a gzipped size around 3 KB
- 02Integrations for Vue 2/3, Alpine.js and Svelte, plus vanilla JS
- 03Works with native and custom input components
- 04Custom tokens with modifiers, transform functions and hooks
- 05Number mask mode for money formatting
- 06Dynamic, reversed and eager masks
Use cases
- Formatting phone numbers or dates in a Vue form
- Adding money-style number formatting to a checkout input
- Applying fixed-format masks in an Alpine.js or Svelte app without extra dependencies
Topics
FAQ
- What is maska?
- Zero-dependency input mask library for Vue, Svelte, Alpine.js and vanilla JavaScript, about 3 KB gzipped. Maska formats text inputs as users type, applying patterns such as phone numbers, dates or card numbers. It has no runtime dependencies and ships as a small library usable from plain JavaScript or through integrations for Vue 2/3, Alpine.js and Svelte.
- Is maska free to use? What license does it have?
- maska is open source under the MIT license. Check the license terms before using it in commercial products.
- Is maska still maintained?
- Actively maintained. The last commit to maska was on Sep 29, 2026.
- What can I use maska for?
- Formatting phone numbers or dates in a Vue form Adding money-style number formatting to a checkout input Applying fixed-format masks in an Alpine.js or Svelte app without extra dependencies
- Where can I get maska?
- The source code and installation instructions are on GitHub: https://github.com/beholdr/maska
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Async state management and data fetching library for web apps, with bindings for React, Vue, Svelte and Solid.
Headless TypeScript/JavaScript table library for building datagrids with full control over markup and styling, across React, Vue, Solid, Svelte and more.
A free, MIT-licensed set of over 6,200 SVG icons on a 24x24 grid, with packages for React, Vue, Svelte, Angular and more.
A modern, lightweight drag and drop toolkit for the web, with a framework-agnostic core and adapters for React, Vue, Svelte and SolidJS.
An open library of about 7,600 brand and cloud SVG icons, available via npm, CDN, CLI, and an MCP server for AI editors.