Skip to main content

Import

Basic usage

Renders a complete self-service portal with four tabs:
  • Subscription — Current plan, features, upgrade/downgrade
  • Invoices — Payment history with PDF downloads
  • Payment — Add, remove, and set default payment methods
  • Settings — Update billing information
Customer portal

Props

'drawer' | 'modal' | 'page'
default:"'drawer'"
Display mode:
  • drawer — Slides in from the right
  • modal — Centered overlay
  • page — Full-page inline view
boolean
Controls visibility in drawer or modal mode.
() => void
Called when the user closes the portal (drawer/modal mode).
'subscription' | 'invoices' | 'payment' | 'settings'
default:"'subscription'"
Which tab to show first.
string
Custom CSS class name.
string
Load a specific customer’s portal data.
Record<string, any>
Custom metadata to pass to the portal session.
(subscription: any) => void
Called when a subscription is upgraded or downgraded.
() => void
Called when a subscription is cancelled.
() => void
Called when a new payment method is added.
() => void
Called when the default payment method changes.
boolean
default:"false"
Enable debug logging.

Examples

Drawer mode (triggered by button)

Full page