<Signature /> components provide a wrapper around the useSignTypedData and useSignMessage wagmi hooks.
These hooks handle EIP712 signatures and personal_sign messages, falling back to eth_sign.
Quick start
You can use theSignature component with the default implementation without passing any subcomponents or pass any subcomponents to fully customize the UI.
Default implementation for EIP712 signatures
Default implementation for personal_sign messages
Signature.tsx
Components
The Signature components provide a complete signature flow:Core Component
<Signature />- Main container that manages the signature lifecycle
<Signature /> subcomponents
<SignatureButton />- Handles signature initiation with customizable labels<SignatureStatus />- Displays current signature status and actions<SignatureToast />- Shows toast notifications for signature events
<SignatureStatus /> and <SignatureToast /> subcomponents
<SignatureLabel />- Displays status text (“Success”, “Confirm in wallet”, etc.)<SignatureIcon />- Shows status icons (pending, success, error)
Component API
Signature
Main wrapper component that manages the signature flow.SignatureButton
Button component that triggers the signature request.SignatureStatus
Container for signature status information.SignatureToast
Toast notification for signature events.Lifecycle States
The signature flow has the following states:init- Initial statepending- Waiting for wallet signaturesuccess- Signature completed successfullyerror- Error occurred during signingreset- Component reset to initial state
onStatus callback:
Error Handling
Errors are handled automatically and displayed in the UI. Common errors include:- User rejected request
- Invalid message format
- Wallet connection issues
Message Types
The<Signature /> component supports two types of messages:
EIP-712 Typed Data
Personal Sign (personal_sign)
Props
SignatureProps
LifecycleStatus
SignatureButton Component
The<SignatureButton /> component provides a customizable button for triggering signature operations. It automatically handles different states and provides a render prop for complete customization:
SignatureButtonProps
Related Components
<Wallet />- Handles the wallet connection<Transaction />- Handles transaction signing