Components
Loading preview...
A customizable newsletter subscription section with a modern design, loading states, and background effects. Features - Customizable title and styling - Built-in form handling and error states - Loading indicators - Animated background effect (optional) - Accessible form inputs - Dark mode support - Responsive design
npx shadcn@latest add https://21st.dev/r/originui/newsletter-sectionimport { NewsletterSection } from "@/components/blocks/newsletter-section"
async function mockSubscribe(email: string) {
// API request simulation
await new Promise(resolve => setTimeout(resolve, 1000))
if (email.includes('error')) {
return { success: false, error: 'Something went wrong!' }
}
return { success: true }
}
function NewsletterSectionDemo() {
return (
<div className="space-y-8">
<NewsletterSection
title="Join our newsletter"
onSubscribe={mockSubscribe}
/>
</div>
)
}
export { NewsletterSectionDemo }