Thumbs and reasons for rating a reply and flagging faults
pnpm dlx shadcn@latest add @notchset-pro/rating-reasonsRate a reply, say what went wrong, and get thanks in place.
Every shadcn style · one file
Import it and pass your content. The props that matter most are listed next.
"use client";
import { RotateCcw } from "@/lib/notchset/icons";
import { Card } from "@/components/ui/notchset/card";
import { CopyIconButton } from "@/components/ui/notchset/copy-button";
import { IconButton } from "@/components/ui/notchset/icon-button";
import { RatingReasons } from "@/components/ui/notchset/rating-reasons";
/*
* A support desk's Assistant answers whether Kavya Nair can get a refund; the reply's row holds Copy, Try again and
* the two thumbs. Down opens what went wrong (the stage picks "Out of date" and writes a note), Send gives thanks in
* place. The morph row shows unrated, the reasons open and the thanks. At work, rated up under a CRM answer.
*/
const CAST = { answer: "Kavya qualifies for a full refund: day 25 of 30, licence unused." };
export default function RatingReasonsDemo() {
const mode = "unrated" as string;
const cast = CAST;
return (
<Card inset className="flex w-[min(100%,var(--ns-width-md))] flex-col gap-2">
<p className="m-0 text-[length:var(--ns-text-body)] leading-[var(--ns-leading-prose)]">{cast.answer}</p>
<RatingReasons key={mode} {...(mode === "down" ? { defaultStep: "asking" as const } : mode === "thanks" ? { defaultStep: "thanked" as const, value: { value: "down" as const, reason: "Out of date" } } : {})}>
<CopyIconButton intent="ghost" value={cast.answer} />
<IconButton size="sm" intent="ghost" label="Try again">
<RotateCcw aria-hidden />
</IconButton>
</RatingReasons>
</Card>
);
}
/* at work: rated up under a CRM answer; held still, as At work always is */
export function AtWork() {
return (
<div data-ns-asleep="" className="w-[min(100%,var(--ns-width-md))]">
<Card inset className="flex flex-col gap-2">
<p className="m-0 text-[length:var(--ns-text-body)] leading-[var(--ns-leading-prose)]">Three deals over $20,000 are set to close in November, led by Figma at $48,000.</p>
<RatingReasons value={{ value: "up" }} />
</Card>
</div>
);
}"use client";
import { RotateCcw } from "@/lib/notchset/icons";
import { Card } from "@/components/ui/notchset/card";
import { CopyIconButton } from "@/components/ui/notchset/copy-button";
import { IconButton } from "@/components/ui/notchset/icon-button";
import { RatingReasons } from "@/components/ui/notchset/rating-reasons";
/*
* A support desk's Assistant answers whether Kavya Nair can get a refund; the reply's row holds Copy, Try again and
* the two thumbs. Down opens what went wrong (the stage picks "Out of date" and writes a note), Send gives thanks in
* place. The morph row shows unrated, the reasons open and the thanks. At work, rated up under a CRM answer.
*/
const CAST = { answer: "Kavya qualifies for a full refund: day 25 of 30, licence unused." };
export default function RatingReasonsDemo() {
const mode = "unrated" as string;
const cast = CAST;
return (
<Card inset className="flex w-[min(100%,var(--ns-width-md))] flex-col gap-2">
<p className="m-0 text-[length:var(--ns-text-body)] leading-[var(--ns-leading-prose)]">{cast.answer}</p>
<RatingReasons key={mode} {...(mode === "down" ? { defaultStep: "asking" as const } : mode === "thanks" ? { defaultStep: "thanked" as const, value: { value: "down" as const, reason: "Out of date" } } : {})}>
<CopyIconButton intent="ghost" value={cast.answer} />
<IconButton size="sm" intent="ghost" label="Try again">
<RotateCcw aria-hidden />
</IconButton>
</RatingReasons>
</Card>
);
}
/* at work: rated up under a CRM answer; held still, as At work always is */
export function AtWork() {
return (
<div data-ns-asleep="" className="w-[min(100%,var(--ns-width-md))]">
<Card inset className="flex flex-col gap-2">
<p className="m-0 text-[length:var(--ns-text-body)] leading-[var(--ns-leading-prose)]">Three deals over $20,000 are set to close in November, led by Figma at $48,000.</p>
<RatingReasons value={{ value: "up" }} />
</Card>
</div>
);
}This example also uses Card, Copy button. This command installs them with it, so the example pastes as it is:
pnpm dlx shadcn@latest add @notchset-pro/rating-reasons @notchset/card @notchset/copy-buttoncomponents/ui/notchset/rating-reasons.tsx
This component is included with Pro.
Try the live preview above. Get Pro to install the source.
LevelOrganism: made of molecules or blocks.
Made ofButton,Chip group,Icon button,Text field
Needs your registry key. Every components.json style gets the same files.
Works with React 18.3 or 19 on Tailwind CSS v4, in any shadcn project. What's tested
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
value–
Rating | nullthe rating already given (a reply from history), or null
onRate–
(rating: Rating) => voidthe person rated: up at once, down when they send its reason
reasonsRATING_REASONS
readonly string[]the reasons a thumbs down offers, 2 to 6 short phrases
defaultStep–
"asking" | "thanked"where it starts: its reasons open, or its thanks said (a reply restored mid-feedback)
labels–
Partial<RatingReasonsLabels>Three usesunder an assistant's reply · a support desk's suggested answer · a generated summary in a CRM
Give your coding assistant the Markdown guide instead of screenshots.
https://notchset.dev/api/mcp (setup)One payment, lifetime.
v2.0.0 · 2026-10-13
Released with the Notchset system.