Require Account
A component that renders content only when an account is selected.
Introduction
RequireAccount conditionally renders children only when a wallet account is selected for the given chain.
Installation
npx polkadot-ui@latest add require-accountUsage
Require Account
Render children only when an account is selected
Please select an account to continue.
Require Account - Basic Example
Render children only when an account is selected
Please select an account to continue
Require Account - With Loading State
Show a loading fallback while resolving accounts
Resolving accounts...
Props
| Prop | Type | Required | Description |
|---|---|---|---|
children | ReactNode | ✅ | Content to render when an account is selected |
fallback | ReactNode | ✅ | Content to render when no account is selected |
loadingFallback | ReactNode | ❌ | Optional content to show while loading |