Skip to main content
Urbicon UI
source

AccountSettingsbeta

Self-service account panel to change name, email and password, and delete the account. Every change except the profile rename asks for the current password first.

01 Usage

Basic

The live preview runs against a mocked demo API (injected via the fetcher prop): the profile rename succeeds, and 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

  • At least 8 characters

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

Profile, email and password each have their own pair of regions inside their own <form> — an assertive role="alert" for the refusal and a polite role="status" for the confirmation — and account deletion has a fourth pair in its section. With three save buttons on one page, one pair per form is what lets a reader tell which save just succeeded; "Profile updated." is announced politely, so it waits for whatever the reader is saying.

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 delete button stays disabled until the password is typed, so enabling it takes a deliberate entry.

The confirm step is a modal dialog

Deletion routes through blocks' ConfirmDialog, which renders aria-modal="true", takes its accessible name from the dialog title, keeps Tab within the dialog, and moves focus back to the trigger on close.

Autofill hints, and focus stays put

Every password field is autoComplete="current-password" except the new one (new-password), and the name and email fields are hinted too. After a save, focus stays on the button and that form's live region announces the result.

03 API Reference

14 props 1 required
Prop
Type
Default
Description

04 Types

Local type definitions used by this component.

7 types
Name
Kind
Category
Used by
Description

05 Installation

Import

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