Ballmac UI home

Feedback Widget

A feedback pill that opens a popover with five face ratings as a radio group, optional topic chips and a comment box, then a thank-you confirmation.

Installation

$ pnpm dlx shadcn@latest add @ballmac/feedback-widget

Usage

import { FeedbackWidget } from "@/components/ballmac/feedback-widget"

The full example is in the Code tab above.

Examples

Helpful page, required comment

API reference

PropTypeDefault
onSubmit

Called with the feedback. Return a promise to show a sending state.

(feedback: FeedbackSubmission) => void | Promise<void>—
topics

Topics people can tag feedback with.

string[]—
triggerLabel

Text on the trigger.

string—
question

Question shown in the panel.

string"How is your experience?"
requireMessage

Require a written message before sending.

booleanfalse
closeAfter

Milliseconds before the panel closes itself after a successful send. 0 keeps it open.

number2200
side

Side the panel opens on.

"top" | "bottom" | "left" | "right""top"
align"start" | "center" | "end""end"
defaultOpen

Initial open state.

booleanfalse

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Arrow keysMove between faces (native radios); each has a text label
TabTopic chips, comment and Send are in order
Screen readersSuccess is announced as a status

Use with AI

<FeedbackWidget onSubmit topics question />. onSubmit receives {rating, message, topic}; return a promise to show sending. Dock it in a corner with your own positioning. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Feedback Widget (@ballmac/feedback-widget) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Collecting product feedback in-app
  • Page 'was this helpful' prompts

Not for

  • Long surveys
  • Support requests; link to a help form

Registry JSON: https://ui.ballmac.com/r/feedback-widget.json

Credits

Free to use in personal and commercial projects.