npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-validation-code

v1.0.8

Published

a validation code component by react

Downloads

31

Readme

react-validation-code

描述

这是一个基于react的验证码组件,通过输入验证码进行二次校验确认,
支持点击切换验证码、自定义样式、自定义点击按钮文案等。

技术栈

react
webpack4

Install

npm install react-validation-code

Usage

import VCode from "react-validation-code";

function getResult(r) {
  console.log(r);
}
const App = () => (
  <VCode
    getResult={getResult}
    tips
    tipsWord="换一张"
    className="xxx"
    placeholder="xxx"
    doneCom={ReactNode}
    errorCom={ReactNode}
  />
);

props

| 参数 | 说明 | 类型 | 默认值 | 是否必须 | | ----------- | -------------------------- | -------------------------------- | ------ | ---------- | | getResult | 输入验证码后的回调 | function | 无 | | | className | 自定义类名 | string | "v-code" | 否 | | placeholder | input 的 placeholder | string | "请输入验证码" | 否 | | tips | 是否显示点击切换验证码按钮 | boolean | false | 否 | | tipsWord | 切换验证码按钮文字 | string | "看不清,换一张" | 否 | | doneCom | 可以写个ReactNode替换自带的验证成功图片 | string or ReactNode | 组件自带的验证成功的图片 | 否 | | errorCom | 可以写个ReactNode替换自带的验证失败图片 | string or ReactNode | 组件自带的验证失败的图片 | 否 |