Overview
The<Turnstile /> component is the primary export of @marsidev/react-turnstile. It renders a Cloudflare Turnstile widget in your React application.
Import
Component Signature
Props
The component accepts all props defined in theTurnstileProps interface, which extends React.HTMLAttributes<HTMLDivElement>.
See the Turnstile Props reference for complete documentation of all available props.
Ref Methods
When usinguseRef or createRef, you gain access to imperative methods via the TurnstileInstance interface.
See the Turnstile Instance reference for all available methods.
Basic Usage
With Ref
Related Types
- TurnstileProps - Component props interface
- TurnstileInstance - Ref methods interface
- ComponentRenderOptions - Widget render options
- ScriptOptions - Script injection options