Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/react-input-mask

Package Overview
Dependencies
Maintainers
0
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/react-input-mask

TypeScript definitions for react-input-mask

  • 3.0.6
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
280K
decreased by-0.47%
Maintainers
0
Weekly downloads
 
Created

What is @types/react-input-mask?

@types/react-input-mask provides TypeScript definitions for the react-input-mask library, which is used to create input masks for form fields in React applications. Input masks are used to format user input in a specific way, such as phone numbers, dates, or credit card numbers.

What are @types/react-input-mask's main functionalities?

Basic Input Mask

This feature allows you to create a basic input mask for a phone number. The mask format '(999) 999-9999' ensures that the user input follows the specified pattern.

```tsx
import React from 'react';
import InputMask from 'react-input-mask';

const PhoneInput: React.FC = () => {
  return (
    <InputMask mask="(999) 999-9999" placeholder="Enter phone number" />
  );
};

export default PhoneInput;
```

Custom Mask Character

This feature allows you to specify a custom mask character. In this example, the mask format '99/99/9999' is used for a date input, and the mask character is set to '_'.

```tsx
import React from 'react';
import InputMask from 'react-input-mask';

const CustomMaskInput: React.FC = () => {
  return (
    <InputMask mask="99/99/9999" maskChar="_" placeholder="Enter date" />
  );
};

export default CustomMaskInput;
```

Mask with Always Visible Placeholder

This feature allows you to create an input mask where the placeholder is always visible. The mask format '9999 9999 9999 9999' is used for a credit card number input, and the 'alwaysShowMask' property ensures that the mask is always visible.

```tsx
import React from 'react';
import InputMask from 'react-input-mask';

const AlwaysVisiblePlaceholderInput: React.FC = () => {
  return (
    <InputMask mask="9999 9999 9999 9999" alwaysShowMask={true} placeholder="Enter credit card number" />
  );
};

export default AlwaysVisiblePlaceholderInput;
```

Other packages similar to @types/react-input-mask

FAQs

Package last updated on 07 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc