X Enterprises
Settings

SettingsPreference

A labeled toggle row for boolean user preferences, with optional description and loading state.

Settings

The Settings category provides two layout-aware row components designed for settings and account pages. They follow a consistent two-column layout (text on the left, control on the right) and are intended to be composed inside UCard containers or plain div wrappers.

Components

<XASettingsPreference />

A horizontal row that pairs a label and optional description on the left with a USwitch toggle on the right. Supports v-model for the boolean value, disabled, and loading states. Extra classes can be injected via containerClass, labelClass, and descriptionClass.

<UCard>
  <template #header>Notification Preferences</template>
  <div class="divide-y divide-neutral-200 dark:divide-neutral-800">
    <XASettingsPreference
      v-model="prefs.emailNotifications"
      label="Email Notifications"
      description="Receive email updates about your account activity."
      class="py-4"
    />
    <XASettingsPreference
      v-model="prefs.marketingEmails"
      label="Marketing Emails"
      description="Tips, product updates, and offers."
      class="py-4"
      :loading="saving"
    />
    <XASettingsPreference
      v-model="prefs.smsAlerts"
      label="SMS Alerts"
      description="Critical alerts sent via text message."
      class="py-4"
      :disabled="!prefs.phoneVerified"
    />
  </div>
</UCard>

Props

PropTypeDefaultDescription
modelValueBooleanfalsev-model for the toggle state
labelStringrequiredPreference label text
descriptionString''Description text shown below the label
disabledBooleanfalseDisable the toggle
loadingBooleanfalseShow loading state on the toggle
containerClassString''Additional classes for the root element
labelClassString''Additional classes for the label
descriptionClassString''Additional classes for the description

Events

EventPayloadDescription
update:modelValuebooleanToggle state changed

AI Context

component: XASettingsPreference
package: "@xenterprises/nuxt-x-app"
category: Settings
use-when: >
  Use XASettingsPreference for any boolean toggle on settings pages —
  notifications, feature flags, privacy options, or app preferences.
  Designed to be stacked inside a UCard with a divide-y layout.
Copyright © 2026