HomeDocsComponentsBlocksChartsThemes
Introduction
  • Introduction
  • Installation
  • Themes
  • Artwork
  • llms.txt
Components
  • Accordion
  • Alert
  • Alert Dialog
  • Amount
  • Aspect Ratio
  • Audio Player
  • Avatar
  • Avatar Upload
  • Badge
  • Banner
  • Breadcrumb
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Code Block
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy Button
  • Countdown
  • Data Grid
  • Data Table
  • Date Picker
  • Date Range Picker
  • Description List
  • Device Mockup
  • Dialog
  • Direction
  • Dot Loader
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • File Upload
  • Hover Card
  • Icon Tile
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Label
  • Menubar
  • Meter
  • Multi Select
  • Native Select
  • Navigation Menu
  • Number Field
  • Pagination
  • Password Strength
  • Phone Input
  • Popover
  • Progress
  • Progress Circle
  • Radio Group
  • Rating
  • Resizable
  • Responsive Dialog
  • Rich Text Editor
  • Scroll Area
  • Segmented Control
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Signature
  • Skeleton
  • Slider
  • Sortable
  • Spinner
  • Stat
  • Stepper
  • Switch
  • Table
  • Tabs
  • Tag Input
  • Terminal
  • Textarea
  • Time Field
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tree
  • Typography
  • Video Player
  • Window Mockup
AI
  • Message Scroller
  • Message
  • Bubble
  • Marker
  • Attachment
  • Questionnaire
  • Composer
  • Reasoning
  • Tool Call
  • Approval Card
  • Citations
Blocks
  • Airtable
  • Airtable Kanban
  • ClickUp List
  • ClickUp Kanban
  • Repeatable Group
  • Command Palette
  • Sign In and Sign Up
  • Availability Scheduler
  • AI Chat
  • Action Bar
  • Notion
  • Banking
  • Lineup Builder
  • Sports Score
  • Strava
  • Sheets
  • Notices
  • Settings
  • Billing
Templates
  • Sign In Page
  • Upload Page
  • Agreement Sign
  • Email
  • Email Composer
  • Share Dialog
Utilities
  • motion
  • sounds
  • scroll-fade
  • shimmer
Another UI. Built on shadcn/ui with Phosphor icons.

Email Composer

PreviousNext

Write an email with recipient chips, a rich text body with a floating format bar, mentions, attachments and send later.

Select text for the format bar, type @ to mention, attach a file, then send.

Full page

Installation#

pnpm dlx shadcn@latest add https://anotherui.dev/r/email.json

Features#

  • Recipient chips. To, Cc and Bcc are Tag Inputs with an avatar on each chip. Contacts are suggested by name and address as you type, and anything that is not an email address is turned away with a shake.
  • A clean subject line. The subject is the ghost Input, with no frame of its own.
  • Format as you write. Select text for a floating bar with bold, italic, underline, alignment and link. Press ⌘K for a link.
  • Mentions. Type @ to pick a contact. The mention is a chip in the body and stays a chip in the HTML.
  • Attachments. The paperclip opens the file picker and each file shows as a File Upload chip with its progress, like "4.8 MB of 12 MB".
  • Send later. Pick tomorrow morning, tomorrow afternoon or Monday morning from the menu.
  • Checked before it sends. With no recipients the To field turns red and shakes. ⌘Enter sends.
  • Window controls. Pass onMinimizedChange, onExpandedChange and onClose to show minimise, full screen and close in the header.

Usage#

import { EmailComposer } from "@/components/blocks/email"
 
<EmailComposer
  accounts={[{ name: "Mia Hart", email: "mia@invoicely.app" }]}
  contacts={contacts}
  defaultTo={["ammar@pixelworks.com"]}
  onUpload={uploadFile}
  onSend={async ({ to, cc, subject, html, files }) => {
    await sendEmail({ to, cc, subject, html, files })
  }}
  onSchedule={(draft, when) => scheduleEmail(draft, when)}
  onSaveDraft={saveDraft}
  onDiscard={() => router.back()}
/>

Props#

  • title. The heading. "New message" by default.
  • accounts. The addresses you can send from. The first is selected.
  • contacts. Suggested recipients and @mentions.
  • defaultTo, defaultCc, defaultSubject, defaultBody. Starting values. The body is markdown.
  • onSend. Runs with the draft. A spinner shows while it runs.
  • onSchedule. Shows Send later and runs with the draft and the chosen time.
  • onSaveDraft, onDiscard. Show the save and discard buttons.
  • onUpload. Sends each attachment with progress. Without it files attach straight away.
  • minimized, onMinimizedChange, expanded, onExpandedChange, onClose. The window controls in the header.
EmailShare Dialog

On This Page

InstallationFeaturesUsageProps