Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A verification code input, autocompletion friendly

NotificationsYou must be signed in to change notification settings

ugogo/react-input-verification-code

Repository files navigation

A verification code input, mobile autocompletion friendly

NPMJavaScript Style Guide

Features

  • Support native autocompletion when receiving a code via SMS
  • Support pasted string

Examples

peerDependencies

{  "react": ">=16.0.0",  "react-dom": ">=16.0.0"}

Install

yarn add react-input-verification-code

Usage

importReactfrom'react';importReactInputVerificationCode,{ReactInputVerificationCodeProps,}from'react-input-verification-code';constcustomProps:ReactInputVerificationCodeProps={autoFocus:true,};exportdefaultfunctionApp(){return<ReactInputVerificationCode{...customProps}/>;}

API

Props

KeyTypeDefaultRequiredDescription
autoFocusbooleanfalsefalseShould focus on first render
inputPropsReact.InputHTMLAttributes<HTMLInputElement>;undefinedfalseAllow passing custom props into the inputs
lengthnumber4falseHow many inputs will be rendered
onChangefunction() => nullfalseFunction called when the value changes
onCompletedfunction() => nullfalseFunction called when the value is completed
placeholderstring·falseInputs placeholder
valuestring""falseDefault value
type'alphanumeric, number'numberfalseShould accepts alphanumeric values or only numbers

Custom Styles

Simply override the styles using the following classnames

.ReactInputVerificationCode-container {/*  */}.ReactInputVerificationCode-item {/*  */}

License

MIT ©ugogo

About

A verification code input, autocompletion friendly

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors7


[8]ページ先頭

©2009-2025 Movatter.jp