FeedbackBar

Thumbs under an answer. A vote opens a few reasons to tick, and Send closes it with a thank-you. AI.

Open playground
Was this helpful?

About

FeedbackBar is a React component in the AI category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { FeedbackBar } from "@ashutoshswamy/smoui" and set onSubmit, reasons.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { FeedbackBar } from "@ashutoshswamy/smoui";

<FeedbackBar onSubmit={({ vote, reasons }) => track(vote, reasons)} />

Props 2

onSubmit

Called when Send is pressed.

(feedback: { vote: "up" | "down"; reasons: string[] }) => void
reasons

Reason chips offered after each vote.

{ up: string[]; down: string[] }