Skip to content

fix(experience): adding flexible size property in turnstile widget #7474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GeisonPiegas
Copy link
Contributor

Summary

Added support for the new size property in the Cloudflare Turnstile widget component.
This allows the widget to scale responsively and fill the available space, making it easier to control its size via custom CSS, especially on the login screen.

By default, the Turnstile widget comes with size="normal" and a maximum width of 300px, which limits its responsiveness.
With this change, we now set the widget to use size="flexible", allowing it to stretch and fill the full container width.

Before:
The Turnstile widget was fixed at a maximum of 300px width, regardless of container size.
Captura de tela de 2025-06-20 22-55-46

After:
By setting a flexible size, the widget can now scale to fill the full container, adapting to larger layouts such as the login screen.
Captura de tela de 2025-06-20 22-38-30

Testing

Tested locally on the login page verifying that the widget now stretches responsively.
Validated across multiple screen sizes (desktop, tablet, mobile).
Confirmed that the Turnstile verification still works after resizing.
Compared rendering between the default size and the new flexible size.

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

Copy link

COMPARE TO master

Total Size Diff 📈 +52 Bytes

Diff by File
Name Diff
packages/experience/src/Providers/CaptchaContextProvider/index.tsx 📈 +28 Bytes
packages/experience/src/include.d/global.d.ts 📈 +24 Bytes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant