@emoji-captcha/react
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Emoji Captcha react client library

Easily integrate emoji captcha in your react apps

emoji captcha demo

React Client Installation

Install emoji-captcha with npm

  npm install @emoji-captcha/react

Install emoji-captcha with yarn

  yarn add @emoji-captcha/react

Usage

Somewhere in your forms

import EmojiCaptcha from "@emoji-captcha/react";

const emojiRes = fetch("somewhere from the earth/emoji-captcha");
// if you are using SSR you can directly put the emoji captcha res

const App = () => {
  const [selectedIdx, setSelectedIdx] = (useState < number) | (null > null);
  return (
    <div>
      <h2>Emoji captcha React component demo</h2>
      <EmojiCaptcha
        onSelect={(val) => setSelectedIdx(val)}
        emojis={emojiRes.emojis}
        question={emojiRes.question}
        questionPrefix="Select"
      />
      <h3>You selected {selectedIdx}</h3>
    </div>
  );
};

export default App;

Readme

Keywords

none

Package Sidebar

Install

npm i @emoji-captcha/react

Weekly Downloads

1

Version

1.0.4

License

none

Unpacked Size

15.7 kB

Total Files

11

Last publish

Collaborators

  • shivamjoker