REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.20 KB
Close
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/react-text-mask/README.md
Text
Base64
# React Input Mask ## Getting started First, install it. ```bash npm i react-text-mask --save ``` Then, require it and use it. ```js import React from 'react' import MaskedInput from 'react-text-mask' export default () => ( <div> <MaskedInput mask={['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/]} /> </div> ) ``` `<MaskedInput/>` is fully compatible with `<input/>` element. So, you can pass it CSS classes, a placeholder attribute, or even an `onBlur` handler. For example, the following works: ```js <MaskedInput mask={['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/]} className="form-control" placeholder="Enter a phone number" guide={false} id="my-input-id" onBlur={() => {}} onChange={() => {}} /> ``` ## Documentation For more information about the `props` that you can pass to the component, see the [documentation here](https://github.com/text-mask/text-mask/blob/master/componentDocumentation.md#readme). ## Example To see an example of the code running, follow these steps: 1. Clone the repo, `git clone git@github.com:text-mask/text-mask.git` 1. `cd text-mask` 1. `npm install` 1. `npm run react:dev` 1. Open [http://localhost:3000](http://localhost:3000) The code of the example is in [`react/example`](https://github.com/text-mask/text-mask/tree/master/react/example). ## Customize Rendered `<input>` Component For advanced uses, you can customize the rendering of the resultant `<input>` via a render prop. This is entirely optional, if no `render` prop is passed, a normal `<input>` is rendered. For example, to use with styled-components, [which requires an innerRef](https://www.styled-components.com/docs/advanced#refs): ```js <MaskedInput mask={['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/]} placeholder="Enter a phone number" id="my-input-id" render={(ref, props) => ( <MyStyledInput innerRef={ref} {...props} /> )} /> const MyStyledInput = styled.input` background: papayawhip; `; ``` ## Contributing We would love some contributions! Check out [this document](https://github.com/text-mask/text-mask/blob/master/howToContribute.md#readme) to get started.
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 4 × Files: 5
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
dist
DIR
-
drwxr-xr-x
2026-02-28 00:27:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
example
DIR
-
drwxr-xr-x
2026-02-28 00:28:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
src
DIR
-
drwxr-xr-x
2026-02-28 00:27:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test
DIR
-
drwxr-xr-x
2026-02-28 00:27:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LICENSE
1.18 KB
lrw-r--r--
2026-02-28 00:26:32
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
898 B
lrw-r--r--
2026-02-28 00:28:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
publish.sh
289 B
lrw-r--r--
2026-02-28 00:28:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
README.md
2.20 KB
lrw-r--r--
2026-02-28 00:28:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
webpack.buildReactIntegration.js
1000 B
lrw-r--r--
2026-02-28 00:27:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).