Reusable newsletter signup form with optional compact layout, client‑side validation, and submission status feedback.
// Source: https://github.com/mperkins0155/llms-txt-hub | License: MIT | Copyright 2025 David Dias
// Provided via justclaw.it.com; keep this notice with the code.
'use client'
import { Button } from '@thedaviddias/design-system/button'
import { Input } from '@thedaviddias/design-system/input'
import { Label } from '@thedaviddias/design-system/label'
import { AlertCircle, CheckCircle, Loader2 } from 'lucide-react'
import { type FormEvent, useId, useState } from 'react'
interface EmailSubscriptionFormProps {
/** Form title */
title?: string
/** Form description */
description?: string
/** Compact mode (inline form) */
compact?: boolean
/** Custom CSS classes */
className?: string
}
interface FormData {
email: string
}
/** Email subscription form for newsletter signups
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key