shadcn.io is not affiliated with official shadcn/ui
Feedback Prompt Multi-Action Banner Block for React
A thumbs vote for a feature-flag tool that opens an optional comment box in place, with a Shine Button Send feedback, a ghost Skip and a thank-you line that replaces the vote.
Installation
Overview
A vote with an optional follow-up for React with Base UI, for a feature you are trying out on part of your audience. Hatchfield's card sits between the page's solid rails with a flask icon, a heading and a sentence at the start and two toggle buttons at the end, "Useful" and "Not for me", each with an icon. Pressing one marks it and opens a comment area under a hairline, in place: a labelled textarea, a Shine Button "Send feedback" and a ghost "Skip". Sending or skipping closes the area and replaces the vote buttons with a thank-you line that takes focus; pressing the chosen vote again takes the vote back and closes the area. It's built from Button, Field, Textarea and Guides with your theme's tokens for every colour; a pressed vote is foreground, so the primary stays on Send. For experiments, beta features and any one-tap feedback that can grow into a note.
FAQ
How do the vote buttons work for assistive technology?
They are two buttons with aria-pressed, inside a fieldset named by the heading, so a screen reader says "Useful, toggle button, pressed". Pressing the pressed one releases it. Because they are separate buttons, a vote can be taken back without a dedicated control, and both are plain Tab stops.
How does the comment area open without shifting the page?
The area is a row in a CSS grid that eases from 0fr to 1fr, so the card grows by about 170 pixels over 300 ms; the content below the block moves with it, since the card is part of the page flow. Closed, the area is invisible and inert, so its textarea and buttons are out of the tab order and out of the accessibility tree. With reduced motion it opens at once.
What does Skip do?
It sends the vote without a comment: the area closes and the thank-you line says "Thanks, your vote is counted." Send feedback sends the vote with the note and says "Thanks, your note is with the team." (or the vote line when the box is empty). Neither is wired to a server: put your request in send and skip, using vote and comment.
Where does focus go after sending?
The buttons are inert once sent, so focus moves to the thank-you line, which is a polite status that screen readers read out. The next Tab carries on after the card. Opening the area does not move focus: the person who voted is still on the vote button and can Tab into the comment.
Related
- 12345Pro
Scale Survey Multi-Action Banner
Choices and promptsA one-question survey for a dashboard redesign: a five-point scale of joined cells that answers in place with Thanks, 4 of 5, then an optional one-line comment.
- Pro
Email Signup Multi-Action Banner
Choices and promptsAn early-access signup for a design studio: a labelled email field with the Shine Button inside it, a validation message, a polite success line and a ghost Remind me later.
- Pro
Feedback FAQ
Votes and reactionsA centred FAQ for a scheduling app: seven accordion rows whose open answers end in a Was this helpful? foot with Yes and No, reason chips after a No, and a polite thank-you.
- Pro
Reading Preferences Multi-Action Banner
Choices and promptsA reading-preferences prompt for a reading app: three toggles with a live preview that changes size, weight and border, a polite count, and Save, Reset and Not now.
- Pro
An acknowledge-once callout for a newsletter platform: a card in card with an info icon, a heading, one sentence and a footer whose checkbox rewrites the outline button from Got it to Dismiss permanently.
- Pro
Inset Star Rating Big CTA
Social proofA card-in-card call to action built on a rating summary: a headline and a Shine Button over a band with a big score and foreground stars beside a five-to-one star histogram, all figures worked out from the counts.