alepha@docs:~/framework/docs/reference/primitives$
cat $settingsDialog.md | pretty
1 min read

#$settingsDialog

#Import

typescript
1import { $settingsDialog } from "@alepha/ui/settings";

#Overview

Declare a settings dialog: a large modal over the current page (full screen on a phone) with a nav of sections, opened with useSettingsDialog(name).open() and closed by itself on any route change.

It registers no route. SettingsDialog draws every declared dialog from inside DialogProvider, so an application with one has nothing to mount. Sections are added from any class with $settingsSection.

ts
 1class AccountSettings { 2  dialog = $settingsDialog({ name: "account", title: "Account" }); 3  4  profile = $settingsSection({ 5    dialog: this.dialog, 6    name: "profile", 7    label: "Profile", 8    icon: createElement(User), 9    lazy: () => import("./AccountProfile.tsx"),10  });11}

A link made outside the dialog opens it with ?<name>=<section> (/?account=sessions): read in the browser, on load and on every client navigation, then stripped from the URL.