
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-code-input-beautify
Advanced tools
This React package allows you to easily add a code input component to your applications. It provides maximum and flexible functionality, helping you to make the UX more engaging and accessible for users, without unnecessary effort.
CodeInput is a flexible React component that provides a customizable input for entering multi-character codes (e.g., OTP, verification codes). You can control the number of input fields, allowed characters, and easily manage input through callbacks for change and submission.
To install the package, use npm or yarn:
npm install react-code-input-beautify
# or
yarn add react-code-input-beautify
import React, { useState } from "react";
import { CodeInput } from "react-code-input-beautify";
import "./index.css";
const App = () => {
const [code, setCode] = useState("");
const handleChange = (value) => {
setCode(value);
};
const handleSubmitEndCode = (value) => {
console.log("Submitted Code:", value);
};
return (
<CodeInput
fields={6}
value={code}
onChange={handleChange}
onSubmitEndCode={handleSubmitEndCode}
condition="alphanumeric"
classNameInput="example-classname-for-inputs"
classNameInputsWrapper="example-classname-for-inputs-wrapper"
typeLetterCase="upperCase"
placeholder="______"
/>
);
};
export default App;
| Prop | Type | Default | Description |
|---|---|---|---|
fields | number | Required | Number of input fields (length of the code). |
value | string | Required | The current value of the input. |
onChange | (value: string) => void | Required | Callback for when the input value changes. |
onSubmitEndCode | (value: string) => void | Optional | Callback triggered when the last character is entered, provided that all fields are also entered |
classNameInput | string | "" | Custom class name for each input field. |
classNameInputsWrapper | string | "" | Custom class name for the input wrapper div. |
condition | "numbers", "letters", "alphanumeric", "any", RegExp | "any" | Condition that defines what type of characters are allowed. |
typeLetterCase | "upperCase", "lowerCase", "any" | "any" | Specifies whether the input should be in uppercase or lowercase. |
placeholder | string | "" | Placeholder to show in the inputs. |
InputsProps | React.InputHTMLAttributes<HTMLInputElement> | {} | Additional props to pass to each input element. |
WrapperProps | React.HTMLAttributes<HTMLDivElement> | {} | Additional props to pass to the wrapper element. |
FAQs
This React package allows you to easily add a code input component to your applications. It provides maximum and flexible functionality, helping you to make the UX more engaging and accessible for users, without unnecessary effort.
The npm package react-code-input-beautify receives a total of 1 weekly downloads. As such, react-code-input-beautify popularity was classified as not popular.
We found that react-code-input-beautify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.