New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-simple-cep-mask

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-cep-mask

Simple input mask for brazilian zipcode.

latest
Source
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

React simple input mask for brazilian zipcode format.

Simple <input /> wrapper to mask the value with a BR zipcode mask.
It will apply all the props given to it, to an input field, enabling any customization.

Componente para adicionar máscara de cep sem dependências. Os props são copiados diretamente para um <input />, permitindo customização.

ttystrudio GIF

Installation

$ yarn add react-simple-cep-mask

Example

Basic Example

import React, { useState } from "react";
import ReactDOM from "react-dom";
import Cep from "react-simple-cep-mask";

const App = () => {
  const [cep, setCep] = useState("");
  return (
    <>
      <h2>Basic example</h2>
      <br />

      <Cep
        value={cep}
        onChange={ (cep) => setCep(cep) } 
      />

      <br />
      <h4>Masked value: {cep}</h4>
    </>
  );
};

ReactDOM.render(<App />, document.getElementById("root"));

With custom props

import React, { useState } from "react";
import ReactDOM from "react-dom";
import Cep from "react-simple-cep-mask";

const App = () => {
  const [cep, setCep] = useState("");
  return (
    <>
      <h2>With custom props</h2>
      <br />

      <Cep
        value={cep}
        onChange={ (cep) => setCep(cep) }
        className="someClass"
        placeholder="Digite seu cep"
       />

      <br />
      <h4>Masked value: {cep}</h4>
    </>
  );
};

ReactDOM.render(<App />, document.getElementById("root"));

License

License

Keywords

CEP

FAQs

Package last updated on 19 Sep 2020

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