# AccountSettings

> The account settings page layout. A title, a section nav (vertical on desktop, tabs on mobile) and a content area, plus SettingsSection blocks and a DangerZone with typed delete confirmation.

Source: https://docs.nasaqui.com/components/account-settings

## Install

```bash
npx shadcn@latest add https://docs.nasaqui.com/r/account-settings.json
```

The frame of a settings page. It switches between sections; the sections themselves (`ProfileForm`,
security components, notifications) are yours, wrapped in `SettingsSection`.

## When to use

- User account settings with several sections.

## When not to use

- App-level or admin settings with deep trees: use `SidebarLayout`.

## Import

```tsx
import { AccountSettings, SettingsSection, DangerZone } from "@fadymondy/nasaq/web";
```

## Quick start

```tsx
<AccountSettings>
  {(section) =>
    section === "profile" ? <ProfileForm {...profileProps} /> :
    section === "danger" ? <DangerZone onDelete={deleteAccount} /> :
    <SettingsSection title="Coming soon" />
  }
</AccountSettings>
```

## Anatomy

```
AccountSettings                data-slot="account-settings"
├─ header (h1, description)
├─ nav                         desktop: buttons; mobile: Tabs (same state)
└─ content                     role="region", named by the active item

SettingsSection                Card: title (h2), description, action, content, footer (hint + actions)
DangerZone                     SettingsSection tone="danger" + AlertDialog with typed confirmation
```

## API

### AccountSettings

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `title`, `description` | `ReactNode` | localised | `description={null}` hides it. |
| `items` | `AccountSettingsItem[]` | `defaultAccountSettingsItems(locale)` | `{ id, label, icon?, description?, tone?, badge?, content? }`. |
| `value`, `defaultValue`, `onValueChange` | `string`, `(id) => void` | first item | Active section. |
| `children` | `ReactNode \| (id) => ReactNode` | none | Content; an item's own `content` wins. |
| `navLabel` | `string` | localised | Accessible name of the nav. |

### SettingsSection

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `title`, `description` | `ReactNode` | required / none | |
| `action` | `ReactNode` | none | Inline end of the header. |
| `footer`, `actions` | `ReactNode` | none | Hint at the start, buttons at the end. |
| `tone` | `"default" \| "danger"` | `"default"` | |
| `headingLevel` | `2 \| 3 \| 4` | `2` | |

### DangerZone

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `onDelete` | `() => Promise<void>` | required | Reject to keep the dialog open and show the error. |
| `confirmText` | `string` | "DELETE" / "حذف" | Phrase to type. Use the email for more weight. |
| `title`, `heading`, `description` | `ReactNode` | localised | |
| `labels` | partial strings | en / ar | Button, dialog and error text. |

## Examples

- **Custom items**: `items={[{ id: "profile", label: "Profile", icon: User }, { id: "billing", label: "Billing", icon: CreditCard, content: <Billing /> }]}`.
- **Controlled**: `value={section} onValueChange={setSection}` to sync with the URL.

## Accessibility

- The desktop nav is a `<nav>` with `aria-current="page"` on the active item; the mobile nav is a tab list with arrow-key navigation.
- The content is a labelled region; each `SettingsSection` is a labelled region too.
- The delete button opens an alert dialog; the red button stays disabled until the phrase matches exactly, and Enter cannot submit early.

## RTL & i18n

- English and Arabic strings follow the Nasaq locale.
- The layout mirrors; the nav sits at the inline start. The typed phrase is `dir="ltr"`.

## Styling & tokens

Uses `bg-nq-selected`, `bg-nq-hover`, `text-nq-danger-text`, `border-nq-danger` and the Card tokens. Extend with `className`.

## Do / Don't

- Do put destructive actions only in the danger zone.
- Do keep each section to one topic.
- Do not skip server-side re-authentication for deletion.

## Related

- [ProfileForm](https://docs.nasaqui.com/components/profile-form)
- [Card](https://docs.nasaqui.com/components/card)
- [AlertDialog](https://docs.nasaqui.com/components/alert-dialog)

## Lab

https://docs.nasaqui.com/?path=/docs/components-account-account-settings--docs

## Code

### React

```tsx
<AccountSettings>
  {(section) =>
    section === "profile" ? <ProfileForm {...profileProps} /> :
    section === "danger" ? <DangerZone onDelete={deleteAccount} /> :
    <SettingsSection title="Coming soon" />
  }
</AccountSettings>
```

### shadcn

```tsx
<AccountSettings>
  {(section) =>
    section === "profile" ? <ProfileForm {...profileProps} /> :
    section === "danger" ? <DangerZone onDelete={deleteAccount} /> :
    <SettingsSection title="Coming soon" />
  }
</AccountSettings>
```

### Vue

```vue
<script setup lang="ts">
import { NqAccountSettings, NqDangerZone, NqSettingsSection } from "@fadymondy/nasaq/vue";

// Your API call; reject to keep the dialog open and show the error.
const deleteAccount = () => new Promise<void>((resolve) => setTimeout(resolve, 600));
</script>

<template>
  <NqAccountSettings v-slot="{ id }">
    <NqDangerZone v-if="id === 'danger'" :on-delete="deleteAccount" />
    <NqSettingsSection v-else :title="id === 'profile' ? 'Profile' : 'Coming soon'" description="Your sections go here." />
  </NqAccountSettings>
</template>
```

### Blade

```blade
<x-nq::account-settings value="profile">
    <x-nq::account-settings.panel id="profile">
        <x-nq::account-settings.settings-section title="Profile" description="How you appear to other people." footer="Last changed 3 days ago" />
    </x-nq::account-settings.panel>
    <x-nq::account-settings.panel id="security">
        <x-nq::account-settings.settings-section title="Security" description="Your password and signed-in devices." />
    </x-nq::account-settings.panel>
    <x-nq::account-settings.panel id="connected">
        <x-nq::account-settings.settings-section title="Connected accounts" description="Sign-in providers linked to this account." />
    </x-nq::account-settings.panel>
    <x-nq::account-settings.panel id="notifications">
        <x-nq::account-settings.settings-section title="Notifications" description="Coming soon" />
    </x-nq::account-settings.panel>
    <x-nq::account-settings.panel id="danger">
        {{-- Your API call; the dialog waits for it. Resolve { error: "…" } or reject to keep the dialog open. --}}
        <x-nq::account-settings.danger-zone x-on:nq-account-delete="$event.detail.waitUntil(new Promise((done) => setTimeout(done, 600)))" />
    </x-nq::account-settings.panel>
</x-nq::account-settings>
```

### HTML + Alpine

```html
<div data-slot="account-settings" x-data="nqAccountSettings(JSON.parse('{\u0022value\u0022:\u0022profile\u0022}'))" x-modelable="value" x-id="['nq-account-settings']" data-uid="nq-account-settings-3d8279"
    class="mx-auto flex w-full max-w-5xl flex-col gap-6">
    <header data-slot="account-settings-header" class="flex flex-col gap-1">
        <h1 class="text-h1 text-foreground">Account settings</h1>
        <p class="text-body text-muted-foreground">Manage your profile, sign-in security and preferences.</p>    </header>
    <div class="grid grid-cols-[minmax(0,1fr)] gap-6 md:grid-cols-[15rem_minmax(0,1fr)] md:items-start md:gap-10">
        <div data-slot="account-settings-nav" class="min-w-0 overflow-x-auto md:overflow-visible">
            <div data-slot="tabs" data-orientation="horizontal" class="flex flex-col gap-0 md:hidden">
                <div data-slot="tabs-list" data-variant="underline" aria-orientation="horizontal" role="tablist" aria-label="Settings sections" x-bind="tablist"
                    class="relative z-0 flex max-w-full gap-5 overflow-x-auto border-b border-border [scrollbar-width:none] [&::-webkit-scrollbar]:hidden">
                                                                    <button type="button" role="tab" data-slot="tabs-tab" x-bind="tab('profile')" data-value="profile" aria-controls="nq-account-settings-3d8279-panel-profile"
                             data-active aria-selected="true" tabindex="0"                             class="inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap text-label text-muted-foreground outline-none transition-colors duration-150 ease-nq hover:text-foreground data-active:text-foreground [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus data-disabled:pointer-events-none data-disabled:opacity-50 h-9 px-0.5">
                            <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
  <circle cx="12" cy="7" r="4"/>
</svg>                            Profile
                        </button>
                                                                    <button type="button" role="tab" data-slot="tabs-tab" x-bind="tab('security')" data-value="security" aria-controls="nq-account-settings-3d8279-panel-security"
                             aria-selected="false" tabindex="-1"                             class="inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap text-label text-muted-foreground outline-none transition-colors duration-150 ease-nq hover:text-foreground data-active:text-foreground [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus data-disabled:pointer-events-none data-disabled:opacity-50 h-9 px-0.5">
                            <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/>
  <path d="m9 12 2 2 4-4"/>
</svg>                            Security
                        </button>
                                                                    <button type="button" role="tab" data-slot="tabs-tab" x-bind="tab('connected')" data-value="connected" aria-controls="nq-account-settings-3d8279-panel-connected"
                             aria-selected="false" tabindex="-1"                             class="inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap text-label text-muted-foreground outline-none transition-colors duration-150 ease-nq hover:text-foreground data-active:text-foreground [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus data-disabled:pointer-events-none data-disabled:opacity-50 h-9 px-0.5">
                            <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M9 17H7A5 5 0 0 1 7 7h2"/>
  <path d="M15 7h2a5 5 0 1 1 0 10h-2"/>
  <line x1="8" x2="16" y1="12" y2="12"/>
</svg>                            Connected accounts
                        </button>
                                                                    <button type="button" role="tab" data-slot="tabs-tab" x-bind="tab('notifications')" data-value="notifications" aria-controls="nq-account-settings-3d8279-panel-notifications"
                             aria-selected="false" tabindex="-1"                             class="inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap text-label text-muted-foreground outline-none transition-colors duration-150 ease-nq hover:text-foreground data-active:text-foreground [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus data-disabled:pointer-events-none data-disabled:opacity-50 h-9 px-0.5">
                            <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M10.268 21a2 2 0 0 0 3.464 0"/>
  <path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"/>
</svg>                            Notifications
                        </button>
                                                                    <button type="button" role="tab" data-slot="tabs-tab" x-bind="tab('danger')" data-value="danger" aria-controls="nq-account-settings-3d8279-panel-danger"
                             aria-selected="false" tabindex="-1"                             class="inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap text-label outline-none transition-colors duration-150 ease-nq hover:text-foreground [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus data-disabled:pointer-events-none data-disabled:opacity-50 h-9 px-0.5 text-nq-danger-text data-active:text-nq-danger-text">
                            <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/>
  <path d="M12 9v4"/>
  <path d="M12 17h.01"/>
</svg>                            Danger zone
                        </button>
                                        <span data-slot="tabs-indicator" aria-hidden="true"
                        class="absolute -z-10 bottom-0 h-0.5 rounded-full bg-primary left-[var(--active-tab-left)] w-[var(--active-tab-width)] transition-[left,width] duration-200 ease-nq"></span>
                </div>
            </div>
            <nav aria-label="Settings sections" class="sticky top-4 hidden md:block">
                <ul class="flex flex-col gap-0.5">
                                                                    <li>
                            <button type="button" id="nq-account-settings-3d8279-nav-profile" x-bind="nav('profile')" data-active="true"
                                                                 aria-current="page"                                 aria-controls="nq-account-settings-3d8279-panel-profile"
                                                                class="flex h-nav-row w-full min-h-[var(--nq-touch-min,0px)] items-center gap-2.5 rounded-control px-3 text-start text-body-sm text-muted-foreground outline-none transition-colors duration-150 ease-nq hover:bg-nq-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus data-[active=true]:bg-nq-selected data-[active=true]:font-medium data-[active=true]:text-foreground [&amp;_svg]:size-4 [&amp;_svg]:shrink-0">
                                <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
  <circle cx="12" cy="7" r="4"/>
</svg>                                <span class="min-w-0 flex-1 truncate">Profile</span>
                                                            </button>
                        </li>
                                                                    <li>
                            <button type="button" id="nq-account-settings-3d8279-nav-security" x-bind="nav('security')" data-active="false"
                                                                                                aria-controls="nq-account-settings-3d8279-panel-security"
                                                                class="flex h-nav-row w-full min-h-[var(--nq-touch-min,0px)] items-center gap-2.5 rounded-control px-3 text-start text-body-sm text-muted-foreground outline-none transition-colors duration-150 ease-nq hover:bg-nq-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus data-[active=true]:bg-nq-selected data-[active=true]:font-medium data-[active=true]:text-foreground [&amp;_svg]:size-4 [&amp;_svg]:shrink-0">
                                <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/>
  <path d="m9 12 2 2 4-4"/>
</svg>                                <span class="min-w-0 flex-1 truncate">Security</span>
                                                            </button>
                        </li>
                                                                    <li>
                            <button type="button" id="nq-account-settings-3d8279-nav-connected" x-bind="nav('connected')" data-active="false"
                                                                                                aria-controls="nq-account-settings-3d8279-panel-connected"
                                                                class="flex h-nav-row w-full min-h-[var(--nq-touch-min,0px)] items-center gap-2.5 rounded-control px-3 text-start text-body-sm text-muted-foreground outline-none transition-colors duration-150 ease-nq hover:bg-nq-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus data-[active=true]:bg-nq-selected data-[active=true]:font-medium data-[active=true]:text-foreground [&amp;_svg]:size-4 [&amp;_svg]:shrink-0">
                                <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M9 17H7A5 5 0 0 1 7 7h2"/>
  <path d="M15 7h2a5 5 0 1 1 0 10h-2"/>
  <line x1="8" x2="16" y1="12" y2="12"/>
</svg>                                <span class="min-w-0 flex-1 truncate">Connected accounts</span>
                                                            </button>
                        </li>
                                                                    <li>
                            <button type="button" id="nq-account-settings-3d8279-nav-notifications" x-bind="nav('notifications')" data-active="false"
                                                                                                aria-controls="nq-account-settings-3d8279-panel-notifications"
                                                                class="flex h-nav-row w-full min-h-[var(--nq-touch-min,0px)] items-center gap-2.5 rounded-control px-3 text-start text-body-sm text-muted-foreground outline-none transition-colors duration-150 ease-nq hover:bg-nq-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus data-[active=true]:bg-nq-selected data-[active=true]:font-medium data-[active=true]:text-foreground [&amp;_svg]:size-4 [&amp;_svg]:shrink-0">
                                <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M10.268 21a2 2 0 0 0 3.464 0"/>
  <path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"/>
</svg>                                <span class="min-w-0 flex-1 truncate">Notifications</span>
                                                            </button>
                        </li>
                                                                    <li>
                            <button type="button" id="nq-account-settings-3d8279-nav-danger" x-bind="nav('danger')" data-active="false"
                                 data-tone="danger"                                                                 aria-controls="nq-account-settings-3d8279-panel-danger"
                                                                class="flex h-nav-row w-full min-h-[var(--nq-touch-min,0px)] items-center gap-2.5 rounded-control px-3 text-start text-body-sm outline-none transition-colors duration-150 ease-nq hover:bg-nq-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus data-[active=true]:bg-nq-selected data-[active=true]:font-medium [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 text-nq-danger-text hover:text-nq-danger-text data-[active=true]:text-nq-danger-text">
                                <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/>
  <path d="M12 9v4"/>
  <path d="M12 17h.01"/>
</svg>                                <span class="min-w-0 flex-1 truncate">Danger zone</span>
                                                            </button>
                        </li>
                                    </ul>
            </nav>
        </div>
        <div class="flex min-w-0 flex-col gap-6">
            <div data-slot="account-settings-content" data-section="profile" role="region" x-bind="panel('profile')"
            class="flex min-w-0 flex-col gap-6"><div role="region" aria-labelledby="nq-settings-section-9c3d958b-title" data-slot="settings-section" data-tone="default"
    class="flex flex-col rounded-card border border-border bg-card py-4 text-card-foreground gap-5">
    <div data-slot="card-header" class="grid auto-rows-min items-start gap-1 px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto]"><h2 data-slot="card-title" id="nq-settings-section-9c3d958b-title" class="text-foreground text-h3">Profile</h2>
        <div data-slot="card-description" class="text-body-sm text-muted-foreground">How you appear to other people.</div></div>
                <div data-slot="settings-section-footer" class="flex items-center px-4 flex-wrap justify-between gap-3 border-t border-border pt-4"><div class="min-w-0 text-caption text-muted-foreground">Last changed 3 days ago</div></div>
    </div></div>
    <div data-slot="account-settings-content" data-section="security" role="region" x-bind="panel('security')"
         hidden     class="flex min-w-0 flex-col gap-6"><div role="region" aria-labelledby="nq-settings-section-b72bdabc-title" data-slot="settings-section" data-tone="default"
    class="flex flex-col rounded-card border border-border bg-card py-4 text-card-foreground gap-5">
    <div data-slot="card-header" class="grid auto-rows-min items-start gap-1 px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto]"><h2 data-slot="card-title" id="nq-settings-section-b72bdabc-title" class="text-foreground text-h3">Security</h2>
        <div data-slot="card-description" class="text-body-sm text-muted-foreground">Your password and signed-in devices.</div></div>
        </div></div>
    <div data-slot="account-settings-content" data-section="connected" role="region" x-bind="panel('connected')"
         hidden     class="flex min-w-0 flex-col gap-6"><div role="region" aria-labelledby="nq-settings-section-f27a01db-title" data-slot="settings-section" data-tone="default"
    class="flex flex-col rounded-card border border-border bg-card py-4 text-card-foreground gap-5">
    <div data-slot="card-header" class="grid auto-rows-min items-start gap-1 px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto]"><h2 data-slot="card-title" id="nq-settings-section-f27a01db-title" class="text-foreground text-h3">Connected accounts</h2>
        <div data-slot="card-description" class="text-body-sm text-muted-foreground">Sign-in providers linked to this account.</div></div>
        </div></div>
    <div data-slot="account-settings-content" data-section="notifications" role="region" x-bind="panel('notifications')"
         hidden     class="flex min-w-0 flex-col gap-6"><div role="region" aria-labelledby="nq-settings-section-498ffd7b-title" data-slot="settings-section" data-tone="default"
    class="flex flex-col rounded-card border border-border bg-card py-4 text-card-foreground gap-5">
    <div data-slot="card-header" class="grid auto-rows-min items-start gap-1 px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto]"><h2 data-slot="card-title" id="nq-settings-section-498ffd7b-title" class="text-foreground text-h3">Notifications</h2>
        <div data-slot="card-description" class="text-body-sm text-muted-foreground">Coming soon</div></div>
        </div></div>
    <div data-slot="account-settings-content" data-section="danger" role="region" x-bind="panel('danger')"
         hidden     class="flex min-w-0 flex-col gap-6"><div role="region" aria-labelledby="nq-settings-section-ea5020cb-title" data-slot="danger-zone" data-tone="danger"
    x-on:nq-account-delete="$event.detail.waitUntil(new Promise((done) =&gt; setTimeout(done, 600)))" class="flex flex-col rounded-card border bg-card py-4 text-card-foreground gap-5 border-nq-danger/40">
    <div data-slot="card-header" class="grid auto-rows-min items-start gap-1 px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto]"><h2 data-slot="card-title" id="nq-settings-section-ea5020cb-title" class="text-h3 text-nq-danger-text">Danger zone</h2></div>
    <div data-slot="card-content" class="px-4"><div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between" x-data="nqDangerZone(JSON.parse('{\u0022phrase\u0022:\u0022DELETE\u0022,\u0022failed\u0022:\u0022Your account could not be deleted. Try again.\u0022}'))">
        <div class="min-w-0">
            <p class="text-label text-foreground">Delete account</p>
            <p class="text-body-sm text-muted-foreground">Permanently delete your account, your data and your access to every workspace. This cannot be undone.</p>
        </div>
        <div data-slot="alert-dialog" x-data="nqAlertDialog(false)" x-modelable="open" x-id="['nq-alert-dialog']" x-model="confirming" class="contents">
    <button data-slot="alert-dialog-trigger"
     type="button"                         aria-haspopup="dialog" x-on:click="show()" :aria-expanded="open" class="inline-flex select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-destructive text-destructive-foreground hover:bg-[color-mix(in_oklab,var(--nq-danger-solid)_88%,var(--nq-fg))] h-control px-[var(--nq-control-pad)] shrink-0">
        Delete account</button>
            <template x-teleport="body">
    <div data-slot="alert-dialog-portal">
        <div data-slot="alert-dialog-backdrop" x-nq-presence="open" class="fixed inset-0 z-50 bg-nq-fg/15 dark:bg-nq-bg/60 transition-opacity duration-150 ease-nq data-starting-style:opacity-0 data-ending-style:opacity-0"></div>
        <div data-slot="alert-dialog-content" x-bind="popup" x-nq-presence="open" x-trap.noscroll="open"
            class="fixed inset-0 z-50 m-auto grid h-fit w-[calc(100%-2rem)] max-w-md gap-4 rounded-floating border border-border bg-popover p-6 text-popover-foreground outline-none max-h-[calc(100dvh-2rem)] overflow-y-auto transition-opacity duration-150 ease-nq data-starting-style:opacity-0 data-ending-style:opacity-0">
            <form novalidate class="grid gap-4" x-on:submit.prevent="remove()">
                    <div data-slot="alert-dialog-header" class="flex flex-col gap-1.5 text-start"><h2 data-slot="alert-dialog-title" :id="$id('nq-alert-dialog', 'title')" class="text-h3 text-foreground">Delete your account?</h2>
                        <p data-slot="alert-dialog-description" :id="$id('nq-alert-dialog', 'description')" class="text-body-sm text-muted-foreground">Everything tied to this account is removed for good. There is no way to get it back.</p></div>
                    <div data-slot="field" x-data="nqField(false)" x-modelable="invalid" x-id="['nq-field']"
         data-valid     x-model="bad" class="flex flex-col gap-1.5">
    <label data-slot="field-label"  class="text-label text-foreground data-disabled:opacity-50">Type ⁨DELETE⁩ to confirm</label>
                        <input data-slot="input" type="text"
     dir="ltr"      name="confirm-delete"             autocomplete="off" autocapitalize="none" autocorrect="off" spellcheck="false" x-bind:value="typed" x-on:input="type($event.target.value)" x-bind:disabled="busy" class="w-full min-w-0 rounded-control border border-input bg-card px-3 text-body text-foreground min-h-[var(--nq-touch-min,0px)] transition-colors duration-150 ease-nq outline-none placeholder:text-muted-foreground focus-visible:border-nq-focus focus-visible:outline-1 focus-visible:outline-nq-focus data-invalid:border-nq-danger aria-invalid:border-nq-danger disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:text-[16px] h-control text-start">
                        <p data-slot="field-description" role="alert" x-show="bad" style="display: none" x-text="error" class="text-caption text-nq-danger-text"></p>
</div>
                    <div data-slot="alert-dialog-footer" class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end"><button data-slot="alert-dialog-cancel"
     type="button"                         autofocus="autofocus" x-on:click="close()" x-bind:disabled="busy" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-foreground hover:bg-nq-hover h-control px-[var(--nq-control-pad)]">
        Cancel</button>
                        <button data-slot="button"
     type="submit"                         x-bind:disabled="! matches || busy" x-bind:data-disabled="(! matches || busy) ? &#039;&#039; : null" x-bind:aria-busy="busy ? &#039;true&#039; : null" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-destructive text-destructive-foreground hover:bg-[color-mix(in_oklab,var(--nq-danger-solid)_88%,var(--nq-fg))] h-control px-[var(--nq-control-pad)]">
        <template x-if="busy"><svg data-slot="spinner" aria-hidden="true" class="size-4 animate-spin motion-reduce:animate-none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M21 12a9 9 0 1 1-6.219-8.56"/>
</svg></template>
                            Delete my account</button></div>
                </form>
        </div>
    </div>
</template>
</div>
    </div></div>
    </div></div>
        </div>
    </div>
</div>
```
