<FeatureGuard> checks a feature key against the tenant’s plan and renders either the protected content or a fallback.
Usage
Props
| Prop | Type | Required | Description |
|---|---|---|---|
featureKey | string | ✅ | Feature to check against the tenant’s plan |
children | ReactNode | ✅ | Rendered when access is granted |
fallback | ReactNode | Rendered when access is denied | |
loadingFallback | ReactNode | Rendered while checking |
Fallback with Upgrade CTA
vs useFeatureAccess
Use <FeatureGuard> for declarative JSX gating. Use useFeatureAccess when you need to control behavior imperatively (e.g., disable a button, redirect programmatically).