
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
nextjs-otp-field-input
Advanced tools
A versatile React component for handling One-Time Password (OTP) input with seamless customization options.
npm install nextjs-otp-field-input
import OtpInput from "nextjs-otp-field-input";
function App() {
const defaultStyle = {
border: "2px solid #ccc",
borderRadius: "8px",
margin: "10px",
fontFamily: "Segoe UI",
height: "50px",
width: "50px",
color: "#000",
fontSize: "20px",
fontWeight: "bold",
};
return (
<OtpInput
length={4}
onChange={(otp) => console.log(otp)}
defaultStyle={defaultStyle}
placeholder={"*"}
isLableShow={true}
darkModeType={true}
/>
);
}
length (required): The number of digits in the OTP.
onChange (required): Callback function triggered when the OTP value changes.
defaultStyle: An optional object to customize the style of each input element.
placeholder: An optional string to set a placeholder character for each input.
darkModeType: An optional Boolean type to set as darkmode or not.
isLableShow: An optional Boolean type to show default lable as "Phone Or Email Otp Input"
You can customize the appearance of the OtpInput
component by providing a defaultStyle
prop. This prop should be an object containing CSS properties for the input elements.
Example:
const customStyle = {
border: "2px solid blue",
borderRadius: "10px",
// Add more styling properties as needed
};
<OtpInput
length={4}
onChange={(otp) => console.log(otp)}
defaultStyle={customStyle}
/>;
We welcome contributions! Please open issues for bug reports or feature requests, and feel free to submit pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A stylish OTP input box for React
The npm package nextjs-otp-field-input receives a total of 0 weekly downloads. As such, nextjs-otp-field-input popularity was classified as not popular.
We found that nextjs-otp-field-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
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.