BloksAtomNewsletterCta

NewsletterCta

Description

The NewsletterCta component is a versatile and interactive element designed for collecting email addresses for newsletter subscriptions. It features a clean, responsive layout with an input field for email entry and a customizable submit button. Upon successful submission, the component displays a configurable success message, enhancing user engagement and providing immediate feedback.

Installation

bash
sabaccui add newsletterCta

Usage

Here's an example of how to use the NewsletterCta component in a Storyblok block:

Preview

Schema

FieldTypeDescriptionDefault
labeltextThe placeholder text for the email input field. This field is required and translatable.-
buttontextThe text displayed on the submit button. This field is required and translatable.-
successTextmarkdownThe message displayed after successful submission. This field is translatable and supports markdown formatting.-

Notes

  1. Form submission is currently simulated with a 2-second delay. Implement actual submission logic in the submit function.
  2. The component is responsive, adjusting its layout for different screen sizes.
  3. Success message is rendered using a Markdown component, allowing for rich text formatting.

Best Practices:

  • Keep the label and button text concise and clear to encourage user action.
  • Use the successText to provide valuable information or next steps for the subscriber.
  • Consider implementing proper form validation and error handling in the submission logic.
  • Ensure compliance with data protection regulations when collecting email addresses.