Feedback Form
A compact sentiment and comment block. A row of five faces reveals an optional comment field once one is picked, then submits. It owns its rating and message state; wire onSubmit to your sink.
How was your experience?
Try it yourself. This one is live, and its code is right below.
How was your experience?
Your feedback helps us make the product better for everyone.
Installation#
Usage#
This example is part of Koala UI
The preview is yours to explore. Its code comes with a Pro license, paid once and used in every project.
Have a license? Unlock it here
API reference#
FeedbackForm
One card that composes a single-select Toggle Group of five faces and a Textarea, and owns the rating and message state. Forwards all native <div> props; accepts className, merged last.
| Prop | Type | Default | Description |
|---|---|---|---|
| onSubmit | (data: FeedbackFormData) => void | Promise<void> | - | Called with { rating, message }, where rating is "1" to "5". Return a promise and the submit button spins until it resolves, then the card shows its success state. |
| title | React.ReactNode | "How was your experience?" | The card heading; null hides it. |
| description | React.ReactNode | "Your feedback helps us make the product better for everyone." | Muted copy under the title; null hides it. |
| action | React.ReactNode | "Send feedback" | The submit button label. |
| defaultRating | string | "" | The face chosen on mount, "1" to "5". |
| showMessage | boolean | true | Reveals the optional message field once a face is chosen; false keeps the form to the rating alone. |
| density | "comfortable" | "compact" | "compact" | Card padding and gap (24px or 16px), title size and control height (36px or 32px). Falls back to the nearest DensityProvider. |