shadcn.io is not affiliated with official shadcn/ui
Reaction Pills Testimonials Block for React
A launch-week chat in a split: the headline and a Shine Button in a rail, and four messages ruled apart by hairlines, each with celebrate, love and ship-it reaction pills that really toggle and count.
Installation
Overview
Testimonials with a reason to touch them, for a fictional form builder called Tidewater. A rail at the start holds the headline, one sentence and a Shine Button that joins the launch thread; a divider sets it apart from the chat. Four customers post in a launch-week thread, and under each message hang three reaction pills: celebrate, love and ship it, each with the number of people who chose it. They are real toggles. Press one and it fills in and its count goes up by one, press it again and the count goes back, while the total in the chat's header follows along. Nothing is saved or sent, so it is a demo of the feeling of a community, not a vote. It's built from Bubble, Message, Toggle, Avatar, Guides and Shine Button, with CSS only and your theme's tokens. For community-led products, where visitors judge a team by how people react to each other.
FAQ
How do I change the messages and the starting counts?
Edit POSTS at the top of the file: each message has a quote, the author's name, role and initials, a relative time, and reacted, the starting count for each reaction in the order of REACTIONS. The header total and every pill are worked out from those numbers and from what the visitor has pressed, so they never disagree. Add a reaction by adding an entry to REACTIONS and a number to each reacted.
How do I use the pills with the keyboard?
Each pill is a toggle button: Tab to it and press Enter or Space. It says whether it is pressed, and a pressed pill also gets a white background and a filled icon, so the state does not rely on colour. The pills of one message are a labelled group that names the message and its total.
What do screen readers hear?
A pill reads as its name and its count, for example "Celebrate 12, toggle button, not pressed". The icons are hidden. After each press one polite status line says what changed, such as "Added Love on Kwame Asante's message: 15." Messages themselves are a list of figures with the author as the caption and the words as a blockquote.
Are the reactions saved?
No. They live in the component's state and reset when the page reloads, and the copy above the chat says so. To record real reactions, send the press to your API from toggle and load the starting counts from it in place of reacted.
How is the block laid out?
It is a split. At the start, a rail holds the headline, a sentence and the Shine Button, and stays in view while the chat scrolls. A solid divider with a + mark where it meets the top rule separates it from the chat, whose four messages are ruled apart by hairlines under a header with the running total. On a phone the rail sits above the chat, a rule between them. Your own messages sit at the end in the text colour, never the primary; the Shine Button is the only primary control.
Related
- Pro
Bubble Chat Testimonials
Chats and postsA reverse split on drafting lines: a group chat of five dispatchers in a hairline frame, alternating message bubbles with a name, role and relative time above each, beside a header and one Shine Button.
- Pro
Notification Centre Testimonials
Chats and postsA reverse split: a notification window in a hairline frame where customer praise arrives as unread rows, with a new-count badge, rows that mark themselves read and a Mark all as read button, beside a header with a Shine Button.
- Pro
Conversation Thread Testimonials
Chats and postsAn email-style thread for a tracing tool that turns a sceptic into an advocate, in a framed window beside a hairline divider: a subject line, earlier messages folded behind a disclosure row, the two latest open, and a Shine Button.
- Pro
Social Post Style Testimonials
Chats and postsSix customer testimonials styled as social posts in cells with overshooting lines: initials avatar, verified tick, handle and age, the post and compact reply, share and like counts, with a Shine Button in the header.
- Pro
Social Posts with Profile Cards Testimonials
Chats and postsCustomer posts about a component kit in a two-column feed, each in a cell with its own lines; hover or focus an @handle for a profile card with a bio, a follower count and a working Follow button, with a link-preview row under every post.
- Pro
Split Light Speech Bubble CTA
Social proofA split call to action built as a short chat: the headline at the start, and at the end a customer's quote in a bubble, answered by a reply bubble that holds the Shine Button to start free.