For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /examples/contact-list.md.

Contact List

A searchable contact list grouped by first letter, with sticky letter headers, a contact dialog, an "Add Contact" form and a delete confirmation.

Built with the UI components: Avatar, Input, Dialog, Alert Dialog, Empty State, Separator, Label and Button.

What it shows

  • Search and grouping with computed() — filtered() applies the query, and grouped() sorts the result and splits it by first letter.
  • Sticky section headers — each letter header uses sticky top-0 and is a direct child of the <scroll-view>. Lynx applies position: sticky only there. See <scroll-view>.
  • Initials avatars — an Avatar shows the initials from initials() when there's no photo.
  • Dialogs to view, add and delete — tapping a contact opens a Dialog. Its Delete button hands off to an Alert Dialog to confirm.
  • A Signal Form to add one — the New Contact dialog's fields bind with [formField]. A validate() rule asks for a name (spaces alone don't count), and Save goes through submit(), which shows the error under the field rather than adding a nameless contact.
  • An empty state — an Empty State shows when no contacts match.