Uai

marketingnewsletter-form.tsx

Color theme

component · 65/108

Newsletter Form

Email signup with consent, validation, submission, success, and duplicate-email states.

Install

Install manuallyView source on GitHub

Anatomy

  • NewsletterForm
  • NewsletterFormLabel
  • NewsletterFormField
  • NewsletterFormInput
  • NewsletterFormSubmit
  • NewsletterFormConsent
  • NewsletterFormMessage

Accessibility3 checks

  • The email input is labelled, uses type email with autocomplete, and is described by the status message.
  • Invalid email or missing consent moves focus to the field that needs attention and announces the reason.
  • Submission stays focusable with aria-disabled while pending. onSubscribe owns delivery and returns success, duplicate, or error.
canvasvariant="inline"marketing
Marketing and conversion

Try ana@example.com to see the already-subscribed state.

newsletter form variant

Code example

usage.tsx
"use client";import {  NewsletterForm,  NewsletterFormConsent,  NewsletterFormField,  NewsletterFormInput,  NewsletterFormLabel,  NewsletterFormMessage,  NewsletterFormSubmit,  type NewsletterFormVariant,  type NewsletterSubmission,} from "@/components/ui/uai/newsletter-form";const subscribers = new Set(["ana@example.com"]);async function subscribe({ email }: NewsletterSubmission) {  await new Promise((resolve) => setTimeout(resolve, 700));  if (email.endsWith("@fail.test")) return "error" as const;  if (subscribers.has(email.toLowerCase())) return "duplicate" as const;  subscribers.add(email.toLowerCase());  return "success" as const;}export function NewsletterFormPreview({ variant = "inline" }: { variant?: NewsletterFormVariant }) {  return (    <NewsletterForm variant={variant} onSubscribe={subscribe}>      <NewsletterFormLabel>Get the monthly product letter</NewsletterFormLabel>      <NewsletterFormField>        <NewsletterFormInput placeholder="you@company.com" />        <NewsletterFormSubmit>Subscribe</NewsletterFormSubmit>      </NewsletterFormField>      <NewsletterFormConsent>        Send me one email a month about releases. Unsubscribe from any issue.      </NewsletterFormConsent>      <NewsletterFormMessage>        Try ana@example.com to see the already-subscribed state.      </NewsletterFormMessage>    </NewsletterForm>  );}

Manual installation

newsletter-form.tsx

Loading component source…

esc
ThinkingAI
MessageAI
CitationAI
AttachmentAI
Tool CallAI
Response StatusAI
Run SummaryAI
Conversation ThreadAI · Block
Research SessionAI · Block
File AnalysisAI · Block
Agent RunAI · Block
Approval CardFeedback
Empty StateFeedback
Status BannerFeedback
Progress SummaryFeedback
Inline FeedbackFeedback
Confirmation DialogFeedback
Activity TimelineFeedback
Skeleton GroupFeedback
Prompt ComposerForms
Form FieldForms
Search FieldForms
Filter BarForms
File UploadForms
Date Range PickerForms
Form Error SummaryForms
Unsaved Changes BarForms
Step IndicatorForms
Task ListData Display
Data Table ToolbarData Display
Metric CardData Display
Description ListData Display
Comparison TableData Display
Kanban BoardData Display
Calendar ViewData Display
Audit LogData Display
App HeaderNavigation
App SidebarNavigation
Breadcrumb TrailNavigation
Page TabsNavigation
Command MenuNavigation
Split PaneNavigation
Sign-in CardAuthentication
Sign-up CardAuthentication
Password RecoveryAuthentication
Code VerificationAuthentication · Block
Onboarding WizardAuthentication · Block
Workspace SetupAuthentication · Block
Coupon FieldCommerce
Quantity PickerCommerce
Cart ItemCommerce
Price SummaryCommerce
Order StatusCommerce
Product DetailCommerce · Block
Product ListingCommerce · Block
Cart DrawerCommerce · Block
CheckoutCommerce · Block
Order TrackingCommerce · Block
Subscription ManagementCommerce · Block
Announcement BarMarketing
Pricing ToggleMarketing
Testimonial CardMarketing
Product GalleryMarketing
Trust PanelMarketing
Newsletter FormMarketing
Hero SectionMarketing · Block
Feature ShowcaseMarketing · Block
Pricing SectionMarketing · Block
Testimonials SectionMarketing · Block
FAQ SectionMarketing · Block
Call to ActionMarketing · Block
Waitlist SectionMarketing · Block
Contact SectionMarketing · Block
Author CardContent
CommentContent
Reaction BarContent
Share MenuContent
Changelog EntryContent
Article PageContent · Block
Documentation PageContent · Block
Changelog PageContent · Block
Comment ThreadContent · Block
Community FeedContent · Block
Public ProfileContent · Block
Map FrameMaps
Map ControlsMaps
Map MarkerMaps
Map LegendMaps
Place CardMaps
Route SummaryMaps
Dashboard ShellApplication · Block
Settings PageApplication · Block
Profile PageApplication · Block
Team ManagementApplication · Block
Notification CenterApplication · Block
Billing PortalApplication · Block
Search ResultsApplication · Block
Resource ManagerOperations · Block
Data ExplorerOperations · Block
Import WorkflowOperations · Block
Approval QueueOperations · Block
Audit Log ViewerOperations · Block
Incident DashboardOperations · Block
Report BuilderOperations · Block
Document FieldBrazil
CEP FieldBrazil
Pix PaymentBrazil
Installment PickerBrazil