shadcn.io is not affiliated with official shadcn/ui
Newsletter FAQ Block for React
A subscribe form in a side header, for a weekly newsletter of product notes: a labelled email field, the Shine Button and a confirmation beside six questions about the newsletter.
Installation
Overview
A newsletter FAQ for React with Base UI. The start column holds the title, one sentence and the subscribe form: a labelled email field, the Shine Button and a line under the button. A wrong address shows a message under the field and keeps focus there; a good one shows a confirmation in the form's own space, so the header never changes height. The end column, behind a split divider, holds six questions about the newsletter itself, cadence, contents, leaving, back issues, privacy and what to do if nothing arrives, in hairline rows with an arrow that turns over while a row is open. It's built from Accordion, Field, Input, Guides, Shine Button and Button, with CSS transitions for the entrance and your theme's tokens for every colour. For newsletter and changelog pages where a visitor wants to know what they're signing up for.
FAQ
Does the form subscribe anyone?
No: nothing leaves the page. subscribe checks the address, shows the button's loading state for a short simulated wait (LATENCY) and then the confirmation. Replace the body of the timeout with a call to your mailing list, and show the confirmation when it answers. The confirmation says to open the message you sent and confirm, so it fits a double opt-in list.
How is the address checked?
problemWith checks that it isn't empty and looks like an address (something, an at sign, a domain with a dot). The message goes under the field, the field is marked invalid and keeps focus, and typing clears it. The field is read-only, not disabled, while the request runs, so it keeps focus. It isn't checked on each key.
What does a screen reader announce?
The field has a visible label, and the error is tied to it. A polite status line says "Subscribing…" while the request runs, then focus moves to the confirmation, which is read out. "Use a different address" empties the field and puts focus back in it.
Are the closed answers in the page's markup?
Yes. The Accordion takes hiddenUntilFound, so every closed answer stays in the markup as hidden="until-found".
How do the questions work with a keyboard?
Each question is a button inside its own h3. Tab moves through the form first, then the questions; Enter or Space opens and closes one, and the button says whether it's expanded.
Tab alone moves between questions on this library: its accordion doesn't take arrow keys.
Related
- Pro
Accordion FAQ
Accordion listsA side-header FAQ for a web analytics tool: the title, one sentence and a contact prompt beside seven questions in an accordion, behind a split divider.
- Pro
FAQ with Contact Card
Contact and signupAn FAQ beside a contact card for an energy supplier: seven questions in an accordion, and behind a split divider a sticky card in card with email, live chat status, phone hours and a Shine Button.
- Pro
Light Email Capture CTA
Forms and captureA newsletter CTA as a band between solid rails: a headline and a sentence at the start, and at the end one Shine Button that opens in place into an email field with its own Shine submit, closes on Escape and ends in a confirmation.
- Pro
Centered Email Capture CTA
Forms and captureA call to action between solid rails that follows the page theme, in a card in card with a two-step email capture: an email field and a Shine Button, then a six-digit code that verifies on the sixth digit and turns into a confirmation in the same space.
- Pro
Centered Email Capture Form Hero
Signup and waitlistA compact centered newsletter hero with the email field in a full-width band between two hairlines: a Shine Button subscribes, then a confirmation replaces the form, over a row of subscriber proof.
- Pro
Chatbot-Style FAQ
Contact and signupAn FAQ you ask like a chat, for a local council: a chat window with six question chips that posts your choice, shows a typing indicator and replies with the FAQ's own answer.