terra vidhal

Poll Survey

Component

About

A multi-step survey with directional question transitions, a progress bar, radio cards that respond to arrow keys and a results view with animated distribution bars. Each answer is highlighted in the results, the distribution is deterministic from a seed, and the survey can be restarted without losing the component state.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Poll Survey to your project and fits it to your theme.

Code

How Poll Survey is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

/**
 * PrequelUI Animate — MIT — https://prequeluianimate.terravidhal.me
 */

import { PollSurvey, type SurveyQuestion } from "@/components/ui/poll-survey";

const QUESTIONS: SurveyQuestion[] = [
  {
    id: "focus",
    prompt: "Which area should get the most attention next?",
    description: "Pick the one that would change your week the most.",
    options: [
      {
        id: "search",
        label: "Faster search",
        description: "Results appear as you type, across every workspace.",
      },
      {
        id: "onboarding",
        label: "Clearer onboarding",
        description: "A shorter first-run flow with a guided checklist.",
      },
      {
        id: "mobile",
        label: "A better mobile layout",
        description: "The full workspace, comfortably usable on a phone.",
      },
      {
        id: "integrations",
        label: "More integrations",
        description: "Connect the tools the team already uses.",
      },
    ],
  },
  {
    id: "frequency",
    prompt: "How often do you use the workspace?",
    description: "This helps us judge which surfaces deserve the polish.",
    options: [
      { id: "daily", label: "Every day" },
      { id: "weekly", label: "A few times a week" },
      { id: "monthly", label: "A few times a month" },
      { id: "rarely", label: "Rarely" },
    ],
  },
  {
    id: "blockers",
    prompt: "What slows you down most often?",
    description: "Choose the friction you run into most.",
    options: [
      {
        id: "finding",
        label: "Finding an old file",
        description: "Search and filters do not narrow things down enough.",
      },
      {
        id: "inviting",
        label: "Inviting collaborators",
        description: "Roles and permissions take too many steps.",
      },
      {
        id: "permissions",
        label: "Understanding permissions",
        description: "It is hard to tell who can see what.",
      },
      {
        id: "exporting",
        label: "Exporting reports",
        description: "The output needs manual clean-up every time.",
      },
    ],
  },
  {
    id: "next",
    prompt: "Which update would help you most?",
    description: "One last pick and you are done.",
    options: [
      { id: "views", label: "Saved views" },
      { id: "bulk", label: "Bulk editing" },
      { id: "shortcuts", label: "Keyboard shortcuts" },
      { id: "light", label: "A lighter mobile app" },
    ],
  },
];

export default function PollSurveyDemo() {
  return (
    <main className="flex min-h-screen w-full items-center justify-center bg-background px-4 py-12 sm:px-6">
      <PollSurvey
        questions={QUESTIONS}
        title="Release survey"
        description="Four quick questions to shape the next release."
        seed={23}
      />
    </main>
  );
}

Dependencies

More by terra vidhal

View all
  • Gravity Stars Background

    Gravity Stars Background

    16
  • Audio Waveform

    Audio Waveform

    13
  • Topographic Lines

    Topographic Lines

    12
  • Notification Center

    Notification Center

    11
  • Booking Calendar

    Booking Calendar

    10
  • Spotlight Card

    Spotlight Card

    10
  • Command Palette

    Command Palette

    9
  • Kpi Counter

    Kpi Counter

    9

Explore more

Part of PrequelUI Animate — browse the full library on 21st.dev.