Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Survey Results Carousel Block for Ark UI

Customer survey results in three section tabs on a vertical rail, each slide three questions drawn as result bars whose percentages add to 100, with a switch between percent and response counts.

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

Read survey results a section at a time with this survey results carousel for React with Ark UI. Pollmoor, a survey tool, groups nine questions into three sections, Product, Support and Pricing, on a vertical rail of tabs beside the track. Each slide holds the section's three questions as figures: every answer is a label, a horizontal bar and its figure, the most-picked answer in the solid foreground and the others lighter, and a table for screen readers follows the bars. Percentages are shared out from the typed counts by the largest-remainder rule, so each question adds to exactly 100. A Segment Group switches the figures between percent and response counts. A press or an arrow key on a tab moves the track, and a swipe or the Previous and Next Buttons move the tab. On a phone the rail becomes a row that scrolls sideways. The ruled bands come from Guides. It's built from Carousel, Segment Group, Button and Guides, with CSS transitions only. The questions and counts are made up.

FAQ

How do I use my own results?

Edit SECTION_LINES. Each question is one string, id|question text|answer:count|answer:count…, with whole people as counts. The responses per question, the shares, the bar widths, the figures and the table for screen readers are all derived from those counts. Add a section by adding an entry to SECTIONS and its lines.

How does it work with a keyboard?

Tab reaches the tabs, then Previous and Next. Only the open tab is a tab stop; the Left and Right arrow keys (mirrored in a right-to-left layout) move to the next or previous tab and open it, and Home and End jump to the first and last. Previous and Next stay in the tab order at the ends and are marked as unavailable instead of disabled, so focus never disappears. Slides that are out of view are hidden from the tab order and from screen readers.

Why do the percentages always add to 100?

Rounding each answer on its own can leave a question at 99 or 101. Each share is rounded down first, then the spare points go to the answers with the largest remainders, the earlier answer first on a tie, so the bars and the figures always total 100.

What is announced when it moves?

The foot line is the block's one polite live region: after each move a screen reader hears it, for example "Section 2 of 3: Support". The track itself is silent, so the same slide is not read twice.

What stays local in the demo?

Everything. The counts are typed example data, the Percent and Responses switch only changes the figures, and nothing is fetched. To wire it for real, load the counts for each question from your survey API into SECTION_LINES or build the same strings from it.

How does it look on a phone?

The rail becomes a row of tabs that scrolls sideways above the track, the bars shrink to the width of the screen and each question keeps its height, so the foot never moves.