Newsletter
Grey rounded box with one sentence of invitation, name and email fields and a full-width dark Subscribe button. Checks the email in place and thanks the reader without leaving the page.
Part of the style
Cut-Out Playhouse
7 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/cut-out-playhouse/newsletter/figma.html
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/cut-out-playhouse/newsletter/figma.html and pass that whole HTML document to the html_to_figma tool, so the part "Newsletter" lands as editable layers in my open Figma file. Fonts come from Google Fonts: if a face is missing in Figma, pick the closest one.
Code
<section class="newsletter" aria-labelledby="newsletter-intro">
<form class="newsletter__box" novalidate>
<p class="newsletter__intro" id="newsletter-intro">Hear about premieres, rehearsal visits, last-minute seats and the odd rumour from the wings. One letter a month, sometimes two when the house is busy.</p>
<label class="newsletter__field">
<span class="newsletter__label">Your name</span>
<input class="newsletter__input" type="text" name="name" autocomplete="name" placeholder="Your name">
</label>
<label class="newsletter__field">
<span class="newsletter__label">Your email address</span>
<input class="newsletter__input" type="email" name="email" autocomplete="email" placeholder="Your email address" required>
</label>
<p class="newsletter__note" aria-live="polite"></p>
<button class="newsletter__submit" type="submit">Subscribe</button>
</form>
</section>
<style>
.newsletter {
padding: var(--space-l) var(--edge) var(--space-xl);
background: var(--paper);
color: var(--ink-soft);
}
.newsletter__box {
display: grid;
gap: var(--space-s);
padding: var(--space-m);
border-radius: var(--radius-button);
background: var(--page);
}
.newsletter__intro {
max-width: 46rem;
margin: 0 0 var(--space-m);
font-size: var(--text-s);
line-height: 1.5;
}
.newsletter__label {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.newsletter__input {
width: 100%;
min-height: var(--tap);
padding: 0 0.75rem;
border: var(--hairline) solid var(--ink-faint);
border-radius: var(--radius-field);
background: var(--paper);
color: var(--ink);
font: inherit;
font-size: var(--text-s);
transition: border-color var(--slow) ease;
}
.newsletter__input::placeholder { color: var(--ink-faint); }
.newsletter__input:focus { outline: none; border-color: var(--ink); }
.newsletter.is-wrong .newsletter__input[type="email"] { border-color: var(--ink); border-width: 2px; }
.newsletter__note {
min-height: 1.25rem;
margin: 0;
font-size: var(--text-s);
font-style: italic;
font-family: var(--font-serif);
}
.newsletter__submit {
min-height: var(--tap);
border: 0;
border-radius: var(--radius-button);
background: var(--ink-soft);
color: var(--paper);
font: inherit;
font-size: var(--text-s);
cursor: pointer;
transition: background-color var(--slow) ease;
}
.newsletter__submit:hover,
.newsletter__submit:focus-visible { background: var(--ink); }
.newsletter__submit:focus-visible { outline: var(--hairline) solid var(--ink); outline-offset: 2px; }
.newsletter.is-done .newsletter__field,
.newsletter.is-done .newsletter__submit { display: none; }
.newsletter.is-done .newsletter__note {
color: var(--ink);
font-size: var(--serif-m);
letter-spacing: var(--tracking-serif);
}
</style>
<script>
(() => {
for (const root of document.querySelectorAll('.newsletter')) {
const form = root.querySelector('.newsletter__box');
const email = root.querySelector('.newsletter__input[type="email"]');
const note = root.querySelector('.newsletter__note');
form.addEventListener('submit', (event) => {
event.preventDefault();
const valid = email.value.trim() !== '' && email.checkValidity();
root.classList.toggle('is-wrong', !valid);
if (!valid) {
note.textContent = 'That address looks unfinished. Check it once more?';
email.focus();
return;
}
root.classList.add('is-done');
note.textContent = 'Thank you. The first letter leaves the box office on Monday.';
});
}
})();
</script>