Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Survey Popup Notification Block for React

A product analytics tool's three-question survey drawn in the corner of its dashboard: answer rows, a word and a bar for where you are, Back and Next, a thank-you with your answers, and Replay survey.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Run a short survey without leaving the page, with this survey popup for React with Base UI. A compact header holds the title and Replay survey; below it a hairline frame shows a drawn dashboard (a top bar, a side list, three figures and a chart in greys), and in its foot corner a card asks three questions, one at a time. Each question is a group of four native radio rows. The card says where you are in words, "Question 2 of 3", and in a hairline Progress bar. Back goes back; the one Shine Button reads Next and then Submit on the last question, and stays quiet and says so until a row is chosen. Submit swaps the questions for a thank-you and a list of what you answered, with Edit answers; Close and Escape leave. The card never opens on a timer: it is the preview's open state, and Replay survey brings it back from the first question. It's built from Progress, Shine Button, Button and Guides, with CSS motion only. For a product survey, a satisfaction check or an onboarding poll.

FAQ

How do I change the questions?

Edit QUESTIONS at the top of the file: each has an id, the question, the list of options and a short name the thank-you uses. The count in "Question 2 of 3", the progress bar and the last step's Submit follow the length of the list; every question should have the same number of options if you want the card to keep one height (they share one cell, so it holds the tallest in any case).

How does the flow work?

Next refuses in words until the question has an answer ("Choose an answer first") and focuses its first row. A valid Next moves to the next question and focus lands on the question's text, which a screen reader reads with the group. Back keeps the answers; on the first question it says it is the first. Enter in a row does the same as Next. Submit shows the thank-you with the answers, and Edit answers returns to the first question with them kept.

What stays local, and how do I make it real?

The answers live in the page and are sent nowhere; the line under the frame says how many are answered. In your app, post the answers in the Submit handler, show a failure in the status line and keep the card until it succeeds, and decide yourself when to show it (after a task, or after a number of visits), never on a timer that interrupts someone mid-action.

What do Close and Escape do?

They close the card and move focus to Replay survey, which brings it back from the first question with the answers cleared. Escape works while focus is inside the frame. The card is not a modal: nothing behind it is hidden or locked, and you can tab past it.

Is it accessible?

The card is a dialog named by its title, each question is a radio group named by its text, and the rows are native radio buttons with visible focus. The progress is said as words and the bar is decoration. The status line is a polite live region that is present from the start and reads each new question, a refusal and the result.

How does it look on a phone?

The card spans the width of the frame minus a margin at its foot, over the top of the drawn dashboard. The questions, the thank-you and the buttons share fixed cells, so nothing in the card changes size between steps.

  • Pro

    A writing app's feedback card drawn over its drafts page: five stars, a question that follows the rating, a thank-you that stays on the page, and a memory in the tab so it asks once and Ask again brings it back.

  • Pro

    Feedback Form Dialog

    Drawers and popovers

    A documentation page with a feedback card docked to its end and shown open: a kind, a message of up to 400 characters with a count, the page it is about, and an optional email that turns on when you let the team reply.

  • Pro

    A 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

    A review request drawn as a phone notification for a candle maker: five named stars, a Remind me select (tomorrow, in 3 days, next week) and Not now, each answering in a polite line that keeps the choice.

  • Pro

    No Feedback Empty State

    Social and feedback

    A feedback widget's popover shown open in place on a drawn settings page: five drawn faces from flat to curved as radio buttons, bars that are all zero, a follow-up field and a Send feedback button that grows one bar.

  • Pro

    A news site's corner cookie card: Reject all and Accept all as equal buttons, a Customize that opens a switch for each optional kind with the cookies it sets, and a one-line receipt you can change.