
Security News
NIST Officially Stops Enriching Most CVEs as Vulnerability Volume Skyrockets
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.
@chakra-ui/pin-input
Advanced tools
The PinInput component is optimized for entering sequences of digits. The most common application is for entering single-use security codes. It is optimized for entering digits quickly.
yarn add @chakra-ui/pin-input
or
npm i @chakra-ui/pin-input
import {
PinInput,
PinInputField,
usePinInput,
usePinInputField,
} from "@chakra-ui/pin-input"
Chakra UI exports two primary components, PinInput and PinInputField to
compose a PinInput component. Chakra UI also provides hooks to can create a
custom PinInput component.
<PinInput defaultValue="234">
<PinInputField />
<PinInputField />
<PinInputField />
</PinInput>
function PinInputHookExample() {
const context = usePinInput({ autoFocus: true })
const input1 = usePinInputField({ context })
const input2 = usePinInputField({ context })
const input3 = usePinInputField({ context })
const input4 = usePinInputField({ context })
return (
<div>
<input style={style} {...input1} />
<input style={style} {...input2} />
<input style={style} {...input3} />
<input style={style} {...input4} />
</div>
)
}
<PinInput size="lg" defaultValue="234">
<PinInputField />
<PinInputField />
<PinInputField />
</PinInput>
function ControlledPinInput() {
const [value, setValue] = React.useState("")
const handleChange = (value: string) => {
setValue(value)
}
const handleComplete = (value: string) => {
console.log(value)
}
return (
<PinInput value={value} onChange={handleChange} onComplete={handleComplete}>
<PinInputField />
<PinInputField />
<PinInputField />
</PinInput>
)
}
react-pin-input is a React component for creating PIN input fields. It offers similar functionality to @chakra-ui/pin-input, including customizable length, focus management, and styling options. However, it may not integrate as seamlessly with the Chakra UI ecosystem.
react-code-input is another React component for creating code or PIN input fields. It provides a variety of customization options, such as different input types and styles. Compared to @chakra-ui/pin-input, it offers more flexibility in terms of input types but may require additional styling to match Chakra UI's design system.
react-otp-input is a React component specifically designed for OTP (One Time Password) inputs. It supports features like auto-focus, customizable length, and input masking. While it offers similar functionality to @chakra-ui/pin-input, it is more focused on OTP use cases and may not provide the same level of integration with Chakra UI.
FAQs
A React component optimized for entering sequences of digits
The npm package @chakra-ui/pin-input receives a total of 310,398 weekly downloads. As such, @chakra-ui/pin-input popularity was classified as popular.
We found that @chakra-ui/pin-input demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.