shadcn.io is not affiliated with official shadcn/ui
Star Rating Feedback Contact Block for React
A product feedback form for a roadmap tool in a card in card: five named stars with a word that follows the choice, switch-on topic chips and a message, ending in a confirmation that lists what was chosen.
Installation
Overview
A feedback section for React with Base UI, built as a card in card. A centred header sits over a muted shell whose corners carry + marks and which holds one raised panel. In the panel the visitor rates the product with five stars (nothing is chosen to begin with) and the word under them follows the choice, from Frustrating to Loved it. Five topic chips (speed, design, price, support, integrations) can be switched on in any number, and a message says the rest. Submitting checks the rating and the message, shows each problem under its field and moves focus to the first one; a valid note turns into a confirmation in the same space that repeats the rating and the topics. It's built from Rating, Toggle Group, Textarea, Field, Frame, Guides, Shine Button and Button, with your theme's tokens for every colour. For product teams, roadmap tools and apps that want a quick, anonymous read on how things are going.
FAQ
Where does the feedback go?
Nowhere yet. The submit handler waits 800 milliseconds as a stand-in for a request, then shows the confirmation, which says plainly that the note was saved in the demo only. Replace the timer in submit with your own call (an inbox, your roadmap tool, a form endpoint): details holds the rating, the topic ids and the message.
How does the star rating work?
It is one control: click a star or use the arrow keys. Each star carries a spoken name such as "4 of 5, Good", and the word under the stars (from WORDS) is announced as it changes. The stars use your foreground colour rather than a gold one. Submitting without a rating asks for one and moves focus to the first star.
How do the topic chips behave?
They are a multiple-choice Toggle Group, so any number can be on, arrow keys move between them and Space switches one. A chip that is on fills with your foreground colour, so the Shine Button stays the only primary control. Topics are optional; the confirmation says "with no topic picked" when none is on. Edit TOPICS for your own list.
Does it work the same on every base?
Yes, on all seven targets. The Toggle Group's multiple-choice props are the one place the libraries differ in code (some take a type, React Aria takes a selection mode and keys); the visible result, the keyboard and the checks are the same.
Related
- Pro
Permissions Matrix Testimonial Contact
Support and feedbackA story form for a plant subscription: the quote, name and role, one circular photo, and a checkbox matrix that says where the words may be used and whether with the name or photo.
- Pro
Study Picker Survey Contact
Join and giveA research panel sign-up on ruled bands: an age select and a five-star app-comfort question, three paid studies as checkbox rows that switch off with a reason, and a running total of studies, minutes and pay.
- Pro
Resolution Ladder Complaint Contact
Support and feedbackA complaint form in a card in card: four resolution cards one per row, each with its handling time, an incident date, an order number checked against its shape, and a switch that adds a Manager review badge.
- Pro
Instrument Picker Music Contact
Visits and servicesA trial-lesson request for a music school with no frame: a band of five instrument chips, a five-star self-rating with the word beside it, an own-instrument switch and a lesson format.
- Pro
Minimal Contact Form
Contact formsThe calmest contact form, for a mail client: a centred heading and three fields on the page column with inline validation, a message counter and a one-line thank-you.
- Pro
Card in Card Contact
Contact formsA card-in-card contact section for a bookkeeping service: the details of the desk you pick beside a raised form with a live message counter.