Components
Components
Four auto-imported XB* components (folder app/components/X/B/). XBBillingGate is the gating primitive; the other three are containers — they wrap the presentational XABilling* components from @xenterprises/nuxt-x-app and drive them with useBilling() state, so they work with zero props.
XBBillingGate
Plan/feature gating wrapper, mirroring XAPermissionGate. With no constraint prop, any entitled subscription (active/trialing by default, configurable via xBilling.entitledStatuses) passes.
<XBBillingGate feature="analytics">
<AnalyticsDashboard />
<template #fallback>
<UpgradePrompt />
</template>
</XBBillingGate>
| Prop | Type | Description |
|---|---|---|
feature | string | Required entitlement key. |
features | string[] | Pass when any listed key is entitled (OR). |
allFeatures | string[] | Pass only when all listed keys are entitled (AND). |
plan | string | Required plan tier (case-insensitive). |
plans | string[] | Pass when the current plan matches any tier (OR). |
invert | boolean | Invert the check (show content to the non-entitled). |
| Slot | Shown when |
|---|---|
default | The gate passes. |
fallback | The gate fails (upsell prompt goes here). |
XBSubscriptionCard
Current subscription card with manage (portal), cancel, resume, and upgrade actions wired to useBilling().
XBPricingGrid
Plan grid with a monthly/yearly toggle, rendered from plans; selecting a plan calls checkout() with the matching Stripe price id and redirects to the hosted checkout page.
XBInvoiceHistory
Invoice table from invoices with download (pdfUrl) and a view action emitted as an event.
view action emits an event but the default /billing page doesn't render an invoice detail view yet — download via pdfUrl works.AI Context
components: [XBBillingGate, XBSubscriptionCard, XBPricingGrid, XBInvoiceHistory]
package: "@xenterprises/nuxt-x-billing"
use-when: >
Billing UI. XBBillingGate gates content on feature/plan entitlements
(default + fallback slots). The XB containers wrap XABilling*
presentationals from nuxt-x-app and run on useBilling() state with
zero required props.
useBilling
Billing state, actions, and entitlement helpers for nuxt-x-billing — subscription/plans/invoices/payment methods, checkout/portal/cancel/resume, hasFeature/hasPlan/canInviteMember.
Pages & opt-outs
The default /billing and /billing/pricing pages shipped by nuxt-x-billing, and how to disable or replace them.
