Skip to main content

x-captcha-container Component

The x-captcha-container component serves as a placeholder for rendering the captcha in your form. This Laravel Blade component can be customized using various supported attributes allowing modification to the theme, size, and language of the captcha.

Usage

The x-captcha-container is embedded in the form where you want to display the captcha:

<form action="" method="post">
...
<x-captcha-container />
</form>

Custom Attributes

With its support for a number of captcha checkbox attributes, it lends a great deal of customization:

data-theme

Modifies the appearance of the captcha by providing dark or light themes.

Example usage:

<x-captcha-container data-theme="dark" />

data-size

Adjusts the size of the captcha checkbox providing compact or normal sizes.

Example:

<x-captcha-container data-size="compact" />

data-language

Changes the language of the Captcha. Supports any language codes supported by Turnstile.

For example, to set the language to Spanish (es):

<x-captcha-container data-language="es" />
caution

The data-language attribute only supported by the Turnstile

Since it's a Laravel Component, x-captcha-container allows adding any other attributes supported by the underlying Captcha service (hCaptcha, reCaptcha, Turnstile). This offers great flexibility in fine-tuning the Captcha to fit your specific usage scenario. Be sure to check the relevant service's documentation for a full list of available attributes.