Captcha
Vue Bootstrap 5 Captcha plugin
Vue Captcha is a form validation component based on Recaptcha. It protects you against spam and
other types of automated abuse.
Official documentation.
Note: Read the API tab to find all available options and advanced customization
Basic example
<template>
<MDBCaptcha siteKey="YOUR_SITEKEY" />
</template>
<script>
import { MDBCaptcha } from 'mdb-vue-captcha';
export default {
components: {
MDBCaptcha
},
};
</script>
Dark theme example
You can set dark theme via theme="dark"
property.
<template>
<MDBCaptcha siteKey="YOUR_SITEKEY" theme="dark" />
</template>
<script>
import { MDBCaptcha } from 'mdb-vue-captcha';
export default {
components: {
MDBCaptcha
},
};
</script>
Captcha - API
Import
import { MDBCaptcha } from "mdb-vue-captcha";
Properties
Name | Type | Values | Default | Description |
---|---|---|---|---|
sitekey
|
String | - | null |
Required. Defines your sitekey. |
theme |
String |
light dark |
light |
Optional. Defines theme for Captcha. |
size
|
String |
normal compact |
normal |
Optional. Defines the size of the widget. |
tabindex
|
Number | - | 0 |
Optional. Defines the tabindex of the widget and chellenge. If other elements in your page use tabindex, it should be set to make user navigation easier. |
lang
|
String | "pl", "en", "es" etc. | en |
Optional. Defines the language of the widget. |
Methods
Name | Description | |
---|---|---|
reset |
Reset the Captcha plugin | instance.reset() |
getResponse |
Returns Captcha response key |
instance.getResponse()
|
Events
Name | Description |
---|---|
error
|
Emmited when CAPTCHA encounters an error. |
expired
|
Emmited when CAPTCHA response expires and the user needs to solve a new CAPTCHA. |
success
|
Emmited when user submits a successful CAPTCHA response |