page NewsletterFormcomponent {
  seo {
    title = "NewsletterForm component"
    description = "Reusable newsletter form component."
  }

  view {
    <div class="docs-shell">
      <SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
      <header class="topbar">
        <a class="brand" href="/"><span>W</span> WRNexusJS</a>
        <nav aria-label="Primary"><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="/components">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
        <div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.3.2</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
      </header>
      <div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="/components">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
      <main class="portal-main docs-layout component-detail-page"><article id="main" class="documentation prose standalone"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/components">Components</a><span>/</span><span aria-current="page">NewsletterForm</span></nav><section class="doc-intro"><span class="eyebrow">content component</span><h1>NewsletterForm</h1><p>Reusable newsletter form component.</p><div class="doc-meta"><span>@wrnexus/ui 0.3.2</span><span>19 props</span><span>0 slots</span><span>2 events</span></div></section><section id="usage"><h2>Usage</h2><p>Components are auto-discovered. Use the component directly in any <code>.wrn</code> view:</p><pre data-language="wrn"><code>&lt;NewsletterForm
  eyebrow=&quot;eyebrow&quot;
  title=&quot;Stay up to date&quot;
  description=&quot;description&quot;
  placeholder=&quot;Enter your email&quot;
  buttonLabel=&quot;Subscribe&quot;
/&gt;</code></pre><p>Legacy mount name: <code>data-component=&quot;NewsletterForm&quot;</code>.</p></section><section id="props"><h2>Props and attributes</h2><div class="table-wrap"><table><thead><tr><th>Prop</th><th>Type</th><th>Requirement</th><th>Default</th></tr></thead><tbody><tr><td><code>class</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;&quot;</code></td></tr><tr><td><code>eyebrow</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;&quot;</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;Stay up to date&quot;</code></td></tr><tr><td><code>description</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;&quot;</code></td></tr><tr><td><code>placeholder</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;Enter your email&quot;</code></td></tr><tr><td><code>buttonLabel</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;Subscribe&quot;</code></td></tr><tr><td><code>action</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;/newsletter/subscribe&quot;</code></td></tr><tr><td><code>method</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;post&quot;</code></td></tr><tr><td><code>emailName</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;email&quot;</code></td></tr><tr><td><code>privacyLabel</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;&quot;</code></td></tr><tr><td><code>privacyHref</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;/privacy&quot;</code></td></tr><tr><td><code>successMessage</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;You are subscribed.&quot;</code></td></tr><tr><td><code>errorMessage</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;Something went wrong. Please try again.&quot;</code></td></tr><tr><td><code>iconClass</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;icon-[lucide--mail]&quot;</code></td></tr><tr><td><code>centered</code></td><td><code>boolean</code></td><td>Optional</td><td><code>false</code></td></tr><tr><td><code>compact</code></td><td><code>boolean</code></td><td>Optional</td><td><code>false</code></td></tr><tr><td><code>showIcon</code></td><td><code>boolean</code></td><td>Optional</td><td><code>true</code></td></tr><tr><td><code>showPrivacy</code></td><td><code>boolean</code></td><td>Optional</td><td><code>true</code></td></tr><tr><td><code>fullWidth</code></td><td><code>boolean</code></td><td>Optional</td><td><code>false</code></td></tr></tbody></table></div></section><section id="slots"><h2>Slots</h2><p>This component does not declare a slot.</p></section><section id="events"><h2>Events</h2><ul><li><code>submit</code></li><li><code>input</code></li></ul></section><section id="source"><h2>Source contract</h2><p>Installed source: <code>components/NewsletterForm.wrn</code></p><pre data-language="wrn"><code>component NewsletterForm &#123;
    props &#123;
        class: string = &quot;&quot;
        eyebrow = &quot;&quot;
        title = &quot;Stay up to date&quot;
        description = &quot;&quot;

        placeholder = &quot;Enter your email&quot;
        buttonLabel = &quot;Subscribe&quot;

        action = &quot;/newsletter/subscribe&quot;
        method = &quot;post&quot;
        emailName = &quot;email&quot;

        privacyLabel = &quot;&quot;
        privacyHref = &quot;/privacy&quot;

        successMessage = &quot;You are subscribed.&quot;
        errorMessage = &quot;Something went wrong. Please try again.&quot;

        iconClass = &quot;icon-[lucide--mail]&quot;

        centered = false
        compact = false
        showIcon = true
        showPrivacy = true
        fullWidth = false
    &#125;

    state email = &quot;&quot;
    state status = &quot;idle&quot;
    state message = &quot;&quot;

    view &#123;
        &lt;section
            aria-labelledby=&quot;newsletter-form-title&quot;
            class=&quot;w-full px-5 sm:px-8 lg:px-10 xl:px-12 &#123;class&#125;&quot;
        &gt;
        &lt;div
                class=&quot; relative mx-auto w-full overflow-hidden rounded-3xl border border-indigo-200/80 bg-linear-to-br from-indigo-50 via-white to-violet-50 shadow-xl shadow-indigo-950/5 dark:border-indigo-500/20 dark:from-indigo-500/10 dark:via-slate-900 dark:to-violet-500/10 dark:shadow-black/20 &quot;
                class:max-w-7xl=&quot;fullWidth&quot;
                class:max-w-3xl=&quot;!fullWidth&quot;
            &gt;
        &lt;!-- Background decoration --&gt;
        &lt;div
                    aria-hidden=&quot;true&quot;
                    class=&quot;pointer-events-none absolute inset-0 overflow-hidden&quot;
                &gt;
        &lt;div class=&quot;absolute -right-20 -top-24 h-64 w-64 rounded-full bg-indigo-300/25 blur-3xl dark:bg-indigo-500/10&quot;&gt;
        &lt;/div&gt;
        &lt;div class=&quot;absolute -bottom-28 -left-20 h-64 w-64 rounded-full bg-violet-300/20 blur-3xl dark:bg-violet-500/10&quot;&gt;
        &lt;/div&gt;
        &lt;div class=&quot;absolute left-1/2 top-0 h-px w-2/3 -translate-x-1/2 bg-linear-to-r from-transparent via-indigo-400/60 to-transparent dark:via-indigo-400/20&quot;&gt;
        &lt;/div&gt;
        &lt;/div&gt;
        &lt;div
                    class=&quot;relative&quot;
                    class:p-5=&quot;compact&quot;
                    class:sm:p-6=&quot;compact&quot;
                    class:p-7=&quot;!compact&quot;
                    class:sm:p-9=&quot;!compact&quot;
                    class:lg:p-10=&quot;!compact&quot;
                &gt;
        &lt;div
                        class=&quot; &#123;compact ? 'flex flex-col gap-5 lg:flex-row lg:items-center lg:justify-between lg:gap-10' : centered ? 'mx-auto flex max-w-2xl flex-col items-center gap-7 text-center' : 'grid gap-8 lg:grid-cols-[minmax(0,1fr)_minmax(360px,480px)] lg:items-center lg:gap-12' &#125; &quot;
                    &gt;
        &lt;!-- Content --&gt;
        &lt;div
                            class=&quot; min-w-0 &#123;compact ? 'max-w-2xl' : ''&#125; &#123;centered &amp;&amp; !compact ? 'w-full max-w-2xl' : ''&#125; &quot;
                        &gt;
        &lt;div class=&quot; flex gap-4 &#123;centered &amp;&amp; !compact ? 'flex-col items-center' : 'items-start' &#125; &quot; &gt;
        &lt;!-- Icon --&gt;
        &lt;div
                                    class=&quot;relative shrink-0&quot;
                                    class:hidden=&quot;!showIcon&quot;
                                &gt;
        &lt;div aria-hidden=&quot;true&quot; class=&quot;absolute inset-1 rounded-2xl bg-indigo-500/25 blur-xl&quot; &gt;
        &lt;/div&gt;
        &lt;span
                                        class=&quot; relative grid place-items-center rounded-2xl border border-indigo-200 bg-white/90 text-indigo-600 shadow-lg shadow-indigo-950/10 backdrop-blur-sm dark:border-indigo-500/20 dark:bg-indigo-500/10 dark:text-indigo-300 dark:shadow-black/20 &#123;compact ? 'h-11 w-11' : 'h-13 w-13'&#125; &quot;
                                    &gt;
        &lt;span class=&quot; &#123;iconClass&#125; &#123;compact ? 'h-5 w-5' : 'h-6 w-6'&#125; &quot; aria-hidden=&quot;true&quot; &gt;
        &lt;/span&gt;
        &lt;/span&gt;
        &lt;/div&gt;
        &lt;div class=&quot;min-w-0&quot;&gt;
        &lt;!-- Eyebrow --&gt;
        &lt;p
                                        class=&quot;text-xs font-bold uppercase tracking-[0.18em] text-indigo-600 dark:text-indigo-400&quot;
                                        class:hidden=&quot;eyebrow === ''&quot;
                                    &gt;
                                        &#123;eyebrow&#125;
                                    &lt;/p&gt;
        &lt;!-- Title --&gt;
        &lt;h2
                                        id=&quot;newsletter-form-title&quot;
                                        class=&quot; font-bold leading-tight tracking-tight text-slate-950 dark:text-white &#123;eyebrow !== '' ? 'mt-2' : ''&#125; &#123;compact ? 'text-xl sm:text-2xl' : 'text-2xl sm:text-3xl' &#125; &quot;
                                    &gt;
                                        &#123;title&#125;
                                    &lt;/h2&gt;
        &lt;/div&gt;
        &lt;/div&gt;
        &lt;!-- Description --&gt;
        &lt;p
                                class=&quot; mt-4 text-sm leading-6 text-slate-600 dark:text-slate-400 &#123;!compact ? 'sm:text-base sm:leading-7' : ''&#125; &#123;centered &amp;&amp; !compact ? 'mx-auto max-w-xl' : 'max-w-2xl' &#125; &quot;
                                class:hidden=&quot;description === ''&quot;
                            &gt;
                                &#123;description&#125;
                            &lt;/p&gt;
        &lt;/div&gt;
        &lt;!-- Form --&gt;
        &lt;div class=&quot; w-full &#123;compact ? 'lg:max-w-xl' : ''&#125; &#123;centered &amp;&amp; !compact ? 'max-w-2xl' : ''&#125; &quot; &gt;
        &lt;form
                                action=&quot;&#123;action&#125;&quot;
                                method=&quot;&#123;method&#125;&quot;
                                class=&quot;w-full&quot;
                                @submit=&quot; status = 'loading'; message = ''; &quot;
                            &gt;
        &lt;label
                                    for=&quot;newsletter-email&quot;
                                    class=&quot;sr-only&quot;
                                &gt;
                                    Email address
                                &lt;/label&gt;
        &lt;div
                                    class=&quot; flex w-full flex-col gap-2 rounded-2xl border border-slate-200 bg-white/85 p-2 shadow-sm backdrop-blur-sm dark:border-white/10 dark:bg-white/5 sm:flex-row &quot;
                                &gt;
        &lt;div class=&quot;relative min-w-0 flex-1&quot;&gt;
        &lt;span class=&quot;pointer-events-none absolute left-3.5 top-1/2 h-4.5 w-4.5 -translate-y-1/2 text-slate-400 icon-[lucide--mail] dark:text-slate-500&quot; aria-hidden=&quot;true&quot; &gt;
        &lt;/span&gt;
        &lt;input
                                            id=&quot;newsletter-email&quot;
                                            type=&quot;email&quot;
                                            name=&quot;&#123;emailName&#125;&quot;
                                            value=&quot;&#123;email&#125;&quot;
                                            placeholder=&quot;&#123;placeholder&#125;&quot;
                                            autocomplete=&quot;email&quot;
                                            required
                                            @input=&quot;email = event.target.value&quot;
                                            class=&quot; w-full rounded-xl bg-transparent pl-10 pr-3 text-sm text-slate-950 outline-none placeholder:text-slate-400 focus:bg-white dark:text-white dark:placeholder:text-slate-500 dark:focus:bg-white/5 &#123;compact ? 'h-10' : 'h-11'&#125; &quot;
                                        /&gt;
        &lt;/div&gt;
        &lt;button
                                        type=&quot;submit&quot;
                                        class=&quot; group inline-flex shrink-0 items-center justify-center gap-2 rounded-xl bg-indigo-600 px-5 text-sm font-bold text-white shadow-lg shadow-indigo-600/20 transition hover:-translate-y-0.5 hover:bg-indigo-500 hover:shadow-xl focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2 disabled:cursor-wait disabled:opacity-70 dark:focus-visible:ring-offset-slate-900 &#123;compact ? 'h-10' : 'h-11'&#125; &quot;
                                        disabled=&quot;&#123;status === 'loading'&#125;&quot;
                                    &gt;
        &lt;span class=&quot;icon-[lucide--loader-circle] h-4 w-4 animate-spin&quot; aria-hidden=&quot;true&quot; class:hidden=&quot;status !== 'loading'&quot; &gt;
        &lt;/span&gt;
        &lt;span class:hidden=&quot;status === 'loading'&quot;&gt;
                                            &#123;buttonLabel&#125;
                                        &lt;/span&gt;
        &lt;span class:hidden=&quot;status !== 'loading'&quot;&gt;
                                            Subscribing
                                        &lt;/span&gt;
        &lt;span class=&quot;icon-[lucide--arrow-right] h-4 w-4 transition-transform group-hover:translate-x-1&quot; aria-hidden=&quot;true&quot; class:hidden=&quot;status === 'loading'&quot; &gt;
        &lt;/span&gt;
        &lt;/button&gt;
        &lt;/div&gt;
        &lt;/form&gt;
        &lt;p
                                class=&quot;mt-3 text-xs leading-5 text-slate-500 dark:text-slate-400&quot;
                                class:hidden=&quot;!showPrivacy&quot;
                                class:text-center=&quot;centered &amp;&amp; !compact&quot;
                            &gt;
                                No spam. Unsubscribe at any time.

                                &lt;a
                                    href=&quot;&#123;privacyHref&#125;&quot;
                                    class=&quot;font-semibold text-indigo-600 transition hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-300&quot;
                                    class:hidden=&quot;privacyLabel === ''&quot;
                                &gt;
                                    &#123;privacyLabel&#125;
                                &lt;/a&gt;
        &lt;/p&gt;
        &lt;div
                                role=&quot;status&quot;
                                aria-live=&quot;polite&quot;
                                class=&quot;mt-3 rounded-xl px-3 py-2.5 text-sm font-medium&quot;
                                class:hidden=&quot;message === ''&quot;
                                class:bg-emerald-50=&quot;status === 'success'&quot;
                                class:text-emerald-700=&quot;status === 'success'&quot;
                                class:ring-1=&quot;status === 'success'&quot;
                                class:ring-inset=&quot;status === 'success'&quot;
                                class:ring-emerald-200=&quot;status === 'success'&quot;
                                class:dark:bg-emerald-500/10=&quot;status === 'success'&quot;
                                class:dark:text-emerald-300=&quot;status === 'success'&quot;
                                class:dark:ring-emerald-500/20=&quot;status === 'success'&quot;
                                class:bg-rose-50=&quot;status === 'error'&quot;
                                class:text-rose-700=&quot;status === 'error'&quot;
                                class:ring-1=&quot;status === 'error'&quot;
                                class:ring-inset=&quot;status === 'error'&quot;
                                class:ring-rose-200=&quot;status === 'error'&quot;
                                class:dark:bg-rose-500/10=&quot;status === 'error'&quot;
                                class:dark:text-rose-300=&quot;status === 'error'&quot;
                                class:dark:ring-rose-500/20=&quot;status === 'error'&quot;
                            &gt;
                                &#123;message&#125;
                            &lt;/div&gt;
        &lt;/div&gt;
        &lt;/div&gt;
        &lt;/div&gt;
        &lt;/div&gt;
        &lt;/section&gt;
    &#125;
&#125;
</code></pre></section></article><aside class="on-this-page"><h2>On this page</h2><nav><a href="#usage">Usage</a><a href="#props">Props and attributes</a><a href="#slots">Slots</a><a href="#events">Events</a><a href="#source">Source contract</a></nav></aside></main>
      <footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.3.2</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
      <BackToTop />
    </div>
  }
}
