
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@idui/react-mask-input
Advanced tools
npm install --save @idui/react-mask-input
yarn add @idui/react-mask-input
import React from 'react'
import MaskInput from '@idui/react-mask-input'
function Example() {
const [value, setValue] = useState('');
return <MaskInput
value={value}
onChange={setValue}
mask="9999 9999 9999 9999"
maskPlaceholder="0000 0000 0000 0000"
fitWidthToMask={false} // whether resize input to mask width or not, default false
placeholder="Enter Card Number"
/>;
}
import React from 'react'
import MaskInput from '@idui/react-mask-input'
const dateRegex = /^(0[1-9]|[1-2]\d|3[0-1])\/(0[1-9]|1[0-2])\/[1-9]\d{3}$/;
const validDate = '01/01/2020';
const validateMaskedValue = (currentMaskedValue) =>
dateRegex.test(
currentMaskedValue + validDate.substring(currentMaskedValue.length)
);
function DateValidation() {
const [value, setValue] = useState('');
return <MaskInput
value={value}
onChange={setValue}
mask="99/99/9999"
maskPlaceholder="DD/MM/YYYY"
validateMaskedValue={validateMaskedValue}
/>;
}
import React from 'react'
import MaskInput from '@idui/react-mask-input'
function Example() {
const [value, setValue] = useState('');
return <MaskInput
value={value}
onChange={setValue}
tokens={{
0: '$',
2: '.',
}}
defaultSymbolPlaceholder=" "
/>;
}
import React from 'react'
import styled from 'styled-components';
import { ifProp } from 'styled-tools';
import MaskInput, {Placeholder} from '@idui/react-mask-input'
const Container = styled.div`
height: 40px;
display: flex;
align-items: center;
padding: 0 10px;
border-radius: 5px;
border: 1px solid #b4b4b4;
color: #313131;
margin-bottom: 10px;
&:focus-within {
border: 1px solid #a569ed;
}
${Placeholder} {
color: ${ifProp({disabled: true}, '#EFEFEF', '#B4B4B4')};
}
`;
function Example() {
const [value, setValue] = useState('');
return <Container>
<MaskInput
value={value}
onChange={setValue}
mask="9999 9999 9999 9999"
maskPlaceholder="0000 0000 0000 0000"
placeholder="Enter Card Number"
/>
</Container>;
}
MIT © kaprisa57@gmail.com
FAQs
React MaskInput Component
The npm package @idui/react-mask-input receives a total of 42 weekly downloads. As such, @idui/react-mask-input popularity was classified as not popular.
We found that @idui/react-mask-input demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.