Skip to main content

Import

Basic usage

Renders children only if the current user has access to the specified feature. Shows nothing by default when access is denied. Feature gate

Props

string
required
The feature key to check access for. Must match a feature key in your BillingOS dashboard.
ReactNode
required
Content to render when the user has access.
ReactNode
Content to render when access is denied. If omitted, nothing is rendered.
ReactNode
Content to render while the entitlement check is loading.
() => void
Called when the user doesn’t have access to the feature.
(usage: number, limit: number) => void
Called when the user has exceeded their usage quota.
boolean
Show remaining usage count as a badge.

Examples

With upgrade prompt fallback

With usage badge

With loading state