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
Field | Type | Description | Default |
---|---|---|---|
label | text | The placeholder text for the email input field. This field is required and translatable. | - |
button | text | The text displayed on the submit button. This field is required and translatable. | - |
successText | markdown | The message displayed after successful submission. This field is translatable and supports markdown formatting. | - |
Notes
- Form submission is currently simulated with a 2-second delay. Implement actual submission logic in the
submit
function. - The component is responsive, adjusting its layout for different screen sizes.
- Success message is rendered using a Markdown component, allowing for rich text formatting.
Best Practices:
- Keep the
label
andbutton
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.