Skip to main content
Urbicon UI
source

AccountSettingsbeta

Self-service account panel: change name, email and password, and delete the account. Each section talks to the account handlers; mutations except the profile rename are password re-auth gated.

01 Usage

Basic

The live preview runs against a mocked demo API (injected via the fetcher prop) — the profile rename succeeds, deleting explains that it needs a real backend. The snippet shows the production setup, where user comes from your auth store or locals.user.

Account settings

Profile

Email address

Current email: sam@example.com

Password

Delete account

This permanently deletes your account and all associated data. This cannot be undone.

<script lang="ts">
  import { AccountSettings } from '@urbicon-ui/auth';
  import type { AuthUser } from '@urbicon-ui/auth';

  // `user` typically comes from your auth store or `locals.user`.
  let { user }: { user: AuthUser | null } = $props();
</script>

<AccountSettings {user} apiPath="/api/auth/account" />

02 Accessibility

One live region per block, not one per page

Profile, email and password each own a separate aria-live="polite" region inside their own <form>, and account deletion has a fourth in its section. With three save buttons on one page, a single shared region would report success with no way to tell which of the three it meant.

The danger zone is a named landmark

Account deletion sits in a <section> with aria-labelledby pointing at its own heading, so it is reachable and distinguishable from the three ordinary save forms above it. The button also stays disabled until the password is typed, so it cannot be triggered by a stray keypress while browsing the page.

The confirm step is a real modal dialog

Deletion routes through blocks' ConfirmDialog, which renders aria-modal="true", takes its accessible name from the dialog title, traps Tab inside itself, and returns focus to the trigger on close.

Autofill hints, and no focus movement

Every password field is autoComplete="current-password" except the new one (new-password), and the name and email fields are hinted too. What the page does not do is move focus: after a save, focus stays on the button and the result is announced by that form's live region.

03 API Reference

10 props 1 required
Prop
Type
Default
Description

04 Types

Local type definitions used by this component.

6 types
Name
Kind
Category
Used by
Description

05 Installation

Import

import { AccountSettings } from '@urbicon-ui/auth';