Skip to main content
UpgradePrompt shows a centered message and an “Upgrade” button. When to use
UpgradePrompt reading Upgrade to Pro to access this feature, with an Upgrade button, light theme

Importing UpgradePrompt

Rendering UpgradePrompt

Pass a plan name and open your plans from onUpgrade. The prompt fetches nothing and shows what you pass.
components/sso-upsell.tsx

What a click does

With onUpgrade, a click calls it and nothing else. Without it, the button sets window.location.href to /upgrade.

Examples

Plan name

planName shows “Upgrade to <planName> to access this feature”.
UpgradePrompt reading Upgrade to Pro to access this feature, with an Upgrade button, light theme

Your own text

Without planName, text is the message.

Open an upgrade modal

Open your plan change flow from onUpgrade, for example an UpgradeModal:

API reference

string
Shows “Upgrade to <planName> to access this feature”. Takes priority over text.
string
default:"Upgrade to access this feature"
The message when planName is not set.
() => void
Fires when “Upgrade” is clicked. Defaults to opening /upgrade: without it the button sets window.location.href to /upgrade.
Appearance
Theme, variables and element overrides on top of the provider’s. See Appearance.

States

UpgradePrompt has one state: the message and the “Upgrade” button.

Appearance

upgradePrompt (root).Style them with appearance.elements. See Elements.

LockedOverlay

This prompt over blurred content.

FeatureGate

Shows it when a feature is not included.