Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Keyword Highlight Testimonials Block for React

Five customer quotes about a UI kit, set large in ruled bands under keyword chips: pick one and every quote that mentions it marks the words, lights a bar and counts where it comes up.

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

Let the visitor read the reviews for the thing they care about. The header row says what the section is, with a row of keyword chips at its end (Types, Dark mode, Handoff, Bundle size, each with a count). Below it five quotes about Mortise, a fictional component kit, run as ruled bands that share their hairlines, with the author on the left and the quote set large on the right and + marks on the outer corners. Pick "Dark mode" and the words that mention it are marked in every quote, a bar lights the edge of those bands, the quotes that don't mention it dim, and a status line says how many do. Nothing is hidden, so the page keeps its full social proof while it answers a specific question. At rest every keyword carries a dotted underline, so the chips read as a guide to the quotes. A last band holds the one filled Shine Button. It's built from Toggle Group, Button, Avatar and Guides with CSS transitions only and your theme's tokens. For feature pages and pricing pages where customers name the capabilities you most want to stand behind.

FAQ

How do I change the quotes and keywords?

Edit KEYWORDS and QUOTES at the top of the file. A quote is a list of parts; give a part a topic matching a keyword's value and those words become markable. Counts, the status line, the dimming and the lit bar are all derived from that data, so nothing else needs editing.

How does picking a keyword work?

The chips are a Toggle Group of pressable buttons with nothing pressed at rest, and only the latest one you press stays on. Pressing a chip marks that keyword in every quote that mentions it; pressing it again, or pressing Clear at the end of the status line, goes back to the resting state. Quotes that don't mention the keyword stay where they are, in a quieter text colour, so this is a highlighter, not a filter: use a filter block if you want quotes to disappear.

How does it work with a keyboard and a screen reader?

Tab moves into the chips, and the arrow keys move between them; Space or Enter presses one. Each chip reads its name, its pressed state and how many quotes mention it, and a polite status line announces the result, such as "Dark mode comes up in 2 of 5 quotes". The marked words are a real mark element, so assistive technology that announces highlights will do so.

Does the page jump when I pick a keyword?

No. Marking words doesn't change their size, the Clear button keeps its space while it is hidden, and the status row reserves its height, so nothing moves when the selection changes. With reduced motion the bar's fade and the colour change are instant and the entrance doesn't play.

Where does the button go?

The last band holds a Shine Button, the only primary control in the block, linking to href="#": point it at your sign-up. It's a ShineButton with render set to an a element and nativeButton={false}.

Does it work in right-to-left languages?

Yes. The quotes sit in a bdi so their quotation marks stay at the ends of each sentence, the author column moves to the right, and the lit bar sits on the reading start edge.

  • Pro

    A full customer review of Copperline, a code-review tool, beside its best sentence pulled out large with the author: the same sentence carries a marker stroke in the review. One hairline band, split in two, with a Shine Button link in the header.

  • Pro

    Four customer quotes in ruled bands where the result sits inside the sentence as a chip: an arrow and the change in percent, worked out from the two figures the customer gives.

  • Pro

    One long customer quote for a release-automation tool, cut into sentences: hover, tap or focus a sentence and the others recede. A split with a header rail, a solid divider and the quote set large, with a Shine Button at its foot.

  • Pro

    Tag Filter Testimonials

    Filter and search

    A wall of nine customer quotes for a component kit in hairline cells, each ending in two topic tags that are buttons: pick one to filter the wall and get a removable chip.

  • Pro

    Search Testimonials

    Filter and search

    A search box in the header row that filters eight customer quotes as you type and marks the matched words, with a result count, Escape to clear and an empty state, in a band of hairline-ruled rows.

  • Pro

    Filterable Testimonials

    Filter and search

    Role chips with live counts filter a wall of eight customer quotes, with a status line, a clear button and an empty state. A hairline band holds the controls and the cells' lines overshoot their corners.