Skip to main content

Components

Pre-built UI components for common upsell scenarios.

UpsellGate

Wraps features and shows an upgrade prompt when blocked:

import { UpsellGate } from '@upsellsdk/react'

function AnalyticsPage() {
return (
<UpsellGate feature="analytics">
<AnalyticsDashboard />
</UpsellGate>
)
}

Props

PropTypeRequiredDescription
featurestringYesFeature key to check
childrenReactNodeYesContent to show when allowed
fallbackReactNodeNoCustom blocked UI

LimitBar

Shows usage progress with an upgrade CTA:

import { LimitBar } from '@upsellsdk/react'

function ProjectsPage({ projects }) {
return (
<div>
<LimitBar
feature="projects"
current={projects.length}
limit={5}
label="projects"
/>
<ProjectList projects={projects} />
</div>
)
}

Props

PropTypeRequiredDescription
featurestringYesFeature key
currentnumberYesCurrent usage
limitnumberYesUsage limit
labelstringNoDisplay label

UpgradeModal

Pre-built pricing/plan selection modal:

import { UpsellProvider, UpgradeModal } from '@upsellsdk/react'

function App() {
return (
<UpsellProvider config={...}>
<YourApp />
<UpgradeModal />
</UpsellProvider>
)
}

The modal opens automatically when users trigger upgrade events.

TrialBanner

Countdown banner for trial users:

import { TrialBanner } from '@upsellsdk/react'

function Layout({ children }) {
return (
<div>
<TrialBanner
trialEndsAt="2024-02-01"
position="top"
/>
{children}
</div>
)
}

Props

PropTypeRequiredDescription
trialEndsAtstringYesISO date string
position'top' | 'bottom'NoBanner position