# solid-imask

> Solid input mask

Latest version **7.6.1** (published 2024-05-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install solid-imask
pnpm add solid-imask
yarn add solid-imask
bun add solid-imask
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 7.6.1 |
| Published | 2024-05-21 |
| First published | 2022-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 181.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5177 |
| Author | Alexey Kryazhev |
| Maintainers | unmanner |
| Keywords | solid, imask, input, mask |

## Links

- npm: https://www.npmjs.com/package/solid-imask
- Repository: https://github.com/uNmAnNeR/imaskjs.git#master
- Homepage: https://github.com/uNmAnNeR/imaskjs/tree/master#readme
- Issues: https://github.com/uNmAnNeR/imaskjs/issues
- npm.io page: https://npm.io/package/solid-imask

## Dependencies (1)

- [imask](https://npm.io/package/imask.md) ^7.6.1

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 7.6.1 (latest) — 2024-05-21
- 7.5.1-alpha.0 (next) — 2024-03-20
- 7.6.0 — 2024-04-09
- 7.5.0 — 2024-02-28
- 7.4.0 — 2024-02-08
- 7.3.0 — 2023-12-25
- 7.2.1 — 2023-12-18
- 7.2.0 — 2023-12-13
- 7.1.3 — 2023-07-18
- 7.1.2 — 2023-07-12
- 7.1.1 — 2023-07-11
- 7.1.0-alpha.2 — 2023-07-11
- 7.1.0-alpha.1 — 2023-07-11
- 7.1.0-alpha.0 — 2023-07-03
- 7.0.1 — 2023-06-23
- … 27 more at https://npm.io/package/solid-imask/versions

## README

# Solid IMask Plugin

solid-imask

[![npm version](https://badge.fury.io/js/react-imask.svg)](https://badge.fury.io/js/react-imask)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

<a href="https://opencollective.com/imask/donate" target="_blank">
  <img src="https://opencollective.com/imask/donate/button.png?color=blue" width=300 />
</a>

## Install

`npm install solid-imask`

## Mask Input Example

```javascript
import { createMaskedInput } from "solid-imask";

const NumberInput = createMaskedInput({
  mask: "+{7}(000)000-00-00",
  lazy: false, // make placeholder always visible
  placeholderChar: "#", // defaults to '_'
});

const App = () => {
  return (
    <div>
      <NumberInput
        onAccept={({ value, unmaskedValue, typedValue }, maskRef, e) => {
          console.log({ value, unmaskedValue, typedValue });
          console.log(maskRef);
          console.log(e);
        }}
        onComplete={() => console.log("complete")}
      ></NumberInput>
    </div>
  );
};
```

## Mask Directive Example

```javascript
import { masked } from "solid-imask";

const mask = {
  mask: "+{7}(000)000-00-00",
  lazy: false, // make placeholder always visible
  placeholderChar: "#", // defaults to '_'
};

const App = () => {
  return (
    <div>
      <input
        use:masked={{
          mask,
          onAccept: ({ value, unmaskedValue, typedValue }, maskRef, e) => {
            console.log({ value, unmaskedValue, typedValue });
            console.log(maskRef);
            console.log(e);
          },
          onComplete: () => console.log("complete"),
        }}
      ></input>
      <p
        contenteditable="true"
        use:masked={{
          mask,
          onAccept: ({ value, unmaskedValue, typedValue }, maskRef, e) => {
            console.log({ value, unmaskedValue, typedValue });
            console.log(maskRef);
            console.log(e);
          },
          onComplete: () => console.log("complete"),
        }}
      ></p>
    </div>
  );
};
```

---
_Source: https://npm.io/package/solid-imask · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
