Inline Newsletter Form
One row, one field, one button - the smallest honest email capture.
6 个框架初级
A full-width strip that sits above the site footer.
<!--
A full-bleed strip that sits above the site footer proper. It paints its own
dark surface at both themes, which is what lets it read as a band across the
page rather than another card - and, conveniently, means its white text has a
fixed contrast ratio instead of an inherited one.
-->
<aside class="nl-bar" aria-labelledby="nl-bar-title">
<div class="nl-bar__inner">
<div class="nl-bar__copy">
<h2 class="nl-bar__title" id="nl-bar-title">Get the monthly roundup</h2>
<p class="nl-bar__text">Product news and field notes. One email a month.</p>
</div>
<form class="nl-bar__form" action="/api/subscribe" method="post">
<label class="nl-bar__label" for="nl-bar-email">Email address</label>
<input
class="nl-bar__input"
id="nl-bar-email"
name="email"
type="email"
autocomplete="email"
placeholder="you@company.com"
required
/>
<button class="nl-bar__submit" type="submit">Sign up</button>
</form>
</div>
</aside>| Prop | 类型 | 默认值 | 说明 |
|---|---|---|---|
title必填 | string | - | 卡片的标题文本。 |
copy | string | - | 显示在标题下方的正文文本。 |
ctaLabel | string | 'Sign up' | 行动号召按钮的文案。 |
className | string | - | 合并到根元素上的额外类名。 |
The bar paints its own dark surface at both themes and has no `dark:` variants at all - that is what makes it read as a band across the page rather than one more card, and it means the white text has a fixed contrast ratio instead of an inherited one. The field inside is styled for the dark band, not the page, so it stays `gray-950` in light mode too. Below `md` the copy and the form stack and the form goes full width; above it, `min-w-96` keeps the input from being crushed by a long headline sharing the row.