solid-grecaptcha
v0.1.6
Published
> Package based on [solid-hcaptcha](https://github.com/Vexcited/solid-hcaptcha) using g-recaptcha of google
Readme
Solid-gRecaptcha
Package based on solid-hcaptcha using g-recaptcha of google
Sign up at g-rcaptcha to get your sitekey today. You need a sitekey to use this library.
Installation
# npm
npm install solid-grecaptcha
# yarn
yarn add solid-grecaptchaImplementation
import GRecaptcha from "solid-grecaptcha";
const App: Component = () => {
return (
<GRecaptcha
sitekey=""
onVerify={token => console.log(token)}
/>
);
};
export default App;References
Props
| Name | Values/Type | Required | Default | Description |
| ---- | ----------- | -------- | ------- | ----------- |
| sitekey | string | Yes | - | This is your sitekey, this allows you to load captcha. If you need a sitekey, please visit g-recaptcha, and sign up to get your sitekey. |
| size | "normal" \| "compact" | No | "normal" | This specifies the "size" of the component. g-recaptcha allows you to decide how big the component will appear on render, this always defaults to normal. |
| theme | "light" \| "dark" | No | "light" | g-recaptcha supports both a light and dark theme. If no theme is inherently set, the captcha will always default to light. |
| tabindex | number | No | 0 | Set the tabindex of the widget and popup. When appropriate, this can make navigation of your site more intuitive. |
Events
| Name | Params | Description |
| ---- | ----------- | -------- |
| onVerify | token:string| Executed when user submits a successful response |
| onError | -| Executed when recaptcha find an error |
| onExpire | -| Executed when response expires and the user needs to re-verify |
