The DlNewsletter inline component renders a styled subscription form wired to your newsletter adapter. It uses Nuxt UI form controls and provides a smooth UX with validation, loading state, and toasts.
Features
- ✉️ email input with built-in native validation
- 🔄 loading state and feedback toasts
- 🔌 integrates with app-configured newsletter adapter
- 🧩 theme-friendly visual adjustments
- 📱 responsive layout
Usage
Use :dl-newsletter as an inline component to render the subscription form. Make sure a newsletter adapter is configured in app.config.ts.
Result:
Configuration
DlNewsletter expects a newsletter adapter function to be defined in your app.config.ts. You can provide it under dl.adapters.newsletter. If no newsletter adapter is configured, the component will not work and report error when used.
On how to create and use adapters you can read here.
Props
Here are the properties you can use with the DlNewsletter component. Each property should be set on an individual component instance; they do not affect the global configuration. More about defining properties in MDC components you can read here.
| name | type | default | description |
|---|---|---|---|
lazy | boolean | undefined | Whether to lazy load the component. |
buttonLabel | string | 'Subscribe' | Label for the submit button. |
inputPlaceholder | string | string | Placeholder text for the email input. |
iui | Record<string, string> | undefined | Special property dedicated to inline components, can be used to add TW classes for certain component markup elements. |
Styling
Styling from Markdown
Every DocLayer component can be styled directly within your Markdown file using dedicated slot/property configuration. This allows you to customize the appearance of the component's markup elements without modifying global styles. More about components styling you can read here.
Below you'll find the default set of Tailwind classes for the component's dedicated markup elements.
