shadcn.io is not affiliated with official shadcn/ui
Scale Survey Multi-Action Banner Block for React
A 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.
Installation
Overview
A one-question survey for React with Base UI, for a number you want from as many people as possible. Nimbusship's card sits between the page's solid rails, centred, with a question and a five-point scale drawn as five joined cells, 1 to 5, with "Not at all" and "Extremely" under the ends. The scale is the action, so the card has no primary button. Choosing a number swaps the row, in the same space, for "Thanks, 4 of 5" with a line about what the team does with it, and a ghost "Add a comment" opens a one-line field and an outline "Send" in place. It's built from Button, Field, Input and Guides with your theme's tokens for every colour. For redesigns, support follow-ups and any feeling you can measure with a single tap.
FAQ
How does a screen reader hear the scale?
The cells are five buttons in a fieldset named "Rate from 1, not at all, to 5, extremely", and each button's name carries its meaning: "1 out of 5, not at all", "3 out of 5", "5 out of 5, extremely". The visible digit is part of the name, so voice control by "click 4" works. Because choosing sends the answer straight away, they are plain buttons rather than radios that need a separate submit.
What happens when someone picks a number?
The scale turns invisible and inert and a thank-you line takes its place in the same grid cell, so nothing moves. The line is a polite status that takes focus, so screen readers read "Thanks, 4 of 5. That helps the team decide what to fix first." and Tab carries on after the card. Send the number to your server in choose.
How does Add a comment work?
It is a ghost button with aria-expanded and aria-controls that opens a row in place (a CSS grid from 0fr to 1fr) with a labelled one-line field and an outline Send button, and moves focus into the field. Send closes the row and swaps the button for "Comment sent." Nothing is stored by the block: read the field in send.
Can a visitor change their answer?
Not in this block: a survey that takes one tap is meant to be answered once. To allow it, add a ghost button to the thank-you line that sets answer back to null; the scale then returns in the same cell.
Why is there no primary button?
The scale is the action, and five cells of equal weight keep any answer from looking preferred. The only other control, Send, is outline and appears only after an answer.
How does it fit on a phone?
The scale keeps one row of five equal cells at the width of the card, each 44 pixels tall, with the two end labels under it, and the question wraps above. At 320 pixels nothing scrolls sideways. In a right-to-left layout the scale mirrors, so 1 sits at the start of the line; put dir="ltr" on the row of cells if you would rather the digits always run from small to large across the screen.
Related
- Pro
Feedback Prompt Multi-Action Banner
Choices and promptsA 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.
- 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
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.
- Pro
Rating FAQ
Votes and reactionsA reverse-split FAQ for a recipe app: seven rows that each show an average rating, with a one-to-five scale at the foot of every open answer and the header beside the rows.
- 4.8Pro
Top Bar Rating Banner
Store barsA centred rating strip: five stars drawn filled to 4.8, the score with its review count, and a link to leave a review.
- 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.