X Enterprises
nuxt-x-billing

Components

XBBillingGate plus the XB* container components (SubscriptionCard, PricingGrid, InvoiceHistory) of nuxt-x-billing — all driven by useBilling() state.

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>
PropTypeDescription
featurestringRequired entitlement key.
featuresstring[]Pass when any listed key is entitled (OR).
allFeaturesstring[]Pass only when all listed keys are entitled (AND).
planstringRequired plan tier (case-insensitive).
plansstring[]Pass when the current plan matches any tier (OR).
invertbooleanInvert the check (show content to the non-entitled).
SlotShown when
defaultThe gate passes.
fallbackThe 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.

Known gap: the 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.
Copyright © 2026