
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@berlinsms/react-codepicker
Advanced tools
Ein konfigurierbarer Code-/PIN-Eingabe-Component für React.
Dieser Component ist besonders geeignet für Anwendungsfälle wie Zwei-Faktor-Authentifizierung, PIN-Abfragen oder Zugangscode-Eingaben.
npm install react-codepicker
Alternativ mit yarn:
yarn add react-codepicker
import React from 'react';
import CodePicker from 'react-codepicker';
import 'react-codepicker/dist/react-codepicker.css';
function MyComponent() {
const handleComplete = (code: string) => {
console.log('Eingegebener Code:', code);
};
const handleRevokeComplete = (code: string) => {
console.log('Not Complete anymore. Wait for input.');
};
return (
<CodePicker
lengthChars={6}
allowedChars="0123456789"
digitClassNames="custom-digit-style"
onComplete={handleComplete}
onRevokeComplete={handleRevokeComplete}
/>
);
}
| Prop | Typ | Standardwert | Beschreibung |
|---|---|---|---|
digitClassNames | string | "code-picker-digit" | CSS-Klassenname für jedes Eingabefeld |
lengthChars | number | 6 | Anzahl der Eingabefelder |
allowedChars | string | "0123456789" | Zulässige Zeichen für die Eingabe |
onComplete | (code: string) => void | () => {} | Callback, der aufgerufen wird, sobald alle Felder ausgefüllt sind |
onRevokeComplete | () => void | () => {} | Callback, der aufgerufen wird, wenn nachträglich wieder ein Feld geleert wird |
Die Komponente erfordert CSS für das Layout der Eingabefelder. Eine Beispiel-Definition ist in react-codepicker.css enthalten:
.code-picker-digit {
width: 2rem;
height: 2.5rem;
margin: 0.25rem;
text-align: center;
font-size: 1.25rem;
border: 1px solid #ccc;
border-radius: 4px;
}
Diese Styles können individuell angepasst oder ersetzt werden.
MIT
FAQs
A configurable PIN/code input component for React
We found that @berlinsms/react-codepicker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.