Skip to content
Twentyfirst UIHalo

Mail Folders

Data · MailFolders

View as Markdown

The folder tree of a mailbox: standard folders with their icons (inbox, drafts, sent, scheduled, starred, archive, junk, trash) and your own folders, nested, with unread counts.

Each folder has a menu, from its "…" button, a right click or Shift+F10: a new folder inside, rename and delete for own folders, and "Empty folder" for trash and junk. Deleting and emptying ask first. Renaming and new folders are edited in place (Enter saves, Esc cancels). Folders with href render as links (linkAs).

Props

MailFolders

PropTypeNotes
foldersMailFolder[]Required
selected?string | nullThe open folder (controlled) / initially / on pick.
defaultSelected?string | null
onSelect?(id: string | null) => void
defaultOpen?string[]Folders with children open at first.
onCreate?(name: string, parent: string | null) => voidNew folder (at the top level or inside `parent`).
onRename?(id: string, name: string) => void
onDelete?(id: string) => voidDelete an own folder (after a confirmation).
onEmpty?(id: string) => voidEmpty trash or junk (after a confirmation).
linkAs?ElementType
label?stringAccessible name of the navigation (default "Folders").
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.