X Enterprises
nuxt-x-tenancy

Components

XTTenantSwitcher and XTTenantResolver — the XT* tenant UI components of nuxt-x-tenancy.

Components

Two auto-imported XT* components (folder app/components/X/T/). Both consume useTenant() internally and need no wiring.

XTTenantSwitcher

A USelectMenu of tenants; selecting one calls switchTenant(), which sets the active organization and flushes the old tenant's useXCrud cache scope.

<template>
  <XTTenantSwitcher placeholder="Select organization" />
</template>
PropTypeDefaultDescription
placeholderstringPlaceholder text when no tenant is active.
hideWhenSinglebooleanfalseRender nothing when the user belongs to only one tenant.

XTTenantResolver

A gate for tenant-scoped content with three slots:

<template>
  <XTTenantResolver>
    <template #loading>
      <USkeleton class="h-8 w-full" />
    </template>

    <template #default="{ tenant }">
      <p>Active tenant: {{ tenant.name }}</p>
    </template>

    <template #empty>
      <p>Select an organization to continue.</p>
    </template>
  </XTTenantResolver>
</template>
SlotScopeShown when
loadingisResolving is true (switching/resolving or org data loading).
default{ tenant: Tenant }A tenant is active.
emptyResolution finished with no active tenant.

AI Context

components: [XTTenantSwitcher, XTTenantResolver]
package: "@xenterprises/nuxt-x-tenancy"
use-when: >
  Tenant UI: XTTenantSwitcher renders a tenant picker that calls
  switchTenant on select; XTTenantResolver gates tenant-scoped content
  with loading/default(scoped tenant)/empty slots.
Copyright © 2026