npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@magik_io/maskit-solid

v1.0.0

Published

SolidJS bindings for Maskit. Provides a `use:maskit` directive and a `<MaskedInput>` component for declarative input masking.

Readme

@maskit/solid

SolidJS bindings for Maskit. Provides a use:maskit directive and a <MaskedInput> component for declarative input masking.

Installation

npm install @maskit/solid @magik_io/maskit-core @magik_io/maskit-dom
# or
pnpm add @maskit/solid @magik_io/maskit-core @magik_io/maskit-dom

Peer dependency: solid-js >= 1.8.0

Usage

use:maskit Directive

import { maskit } from "@maskit/solid";

function PhoneInput() {
  // Required to prevent tree-shaking of the directive
  void maskit;

  return (
    <input
      type="text"
      use:maskit={{ mask: "(999) 999-9999" }}
    />
  );
}

Reactive options — the mask re-applies automatically when options change:

import { createSignal } from "solid-js";
import { maskit } from "@maskit/solid";

function DynamicMask() {
  void maskit;
  const [maskOpts, setMaskOpts] = createSignal({ mask: "999-9999" });

  return (
    <>
      <input use:maskit={maskOpts()} />
      <button onClick={() => setMaskOpts({ mask: "(999) 999-9999" })}>
        Switch to full phone
      </button>
    </>
  );
}

<MaskedInput> Component

import { MaskedInput } from "@maskit/solid";

function App() {
  return (
    <MaskedInput
      options={{ mask: "99/99/9999" }}
      placeholder="Enter date"
      class="my-input"
      onController={(controller) => {
        console.log("Mask applied:", controller.value());
      }}
    />
  );
}

Props:

| Prop | Type | Description | |------|------|-------------| | options | CreateMaskOptions | Mask configuration (required) | | onController | (ctrl: MaskController) => void | Callback when mask controller is created | | ref | (el: HTMLInputElement) => void | Ref callback for the underlying input | | ...rest | JSX.InputHTMLAttributes | All standard input attributes are forwarded |

Reactive options:

import { createSignal } from "solid-js";
import { MaskedInput } from "@maskit/solid";

function App() {
  const [opts, setOpts] = createSignal({ mask: "999-9999" });

  return (
    <MaskedInput
      options={opts()}
      onController={(ctrl) => console.log(ctrl.value())}
    />
  );
}

Accessing the Controller

Both the directive and component provide access to the MaskController from @magik_io/maskit-dom:

import { MaskedInput } from "@maskit/solid";
import type { MaskController } from "@magik_io/maskit-dom";

function App() {
  let controller: MaskController | undefined;

  return (
    <>
      <MaskedInput
        options={{ mask: "(999) 999-9999" }}
        onController={(ctrl) => { controller = ctrl; }}
      />
      <button onClick={() => console.log(controller?.unmaskedValue())}>
        Get Value
      </button>
    </>
  );
}

TypeScript

The package extends the SolidJS JSX namespace to provide type checking for the use:maskit directive:

// Fully typed — TypeScript knows about use:maskit
<input use:maskit={{ mask: "99-99-99" }} />

Cleanup

Both the directive and component automatically clean up (destroy the mask, unbind events) when the component is unmounted via SolidJS's onCleanup.

License

MIT