Skip to content
kitn AI/UI

Feedback Bar

kai-feedback-bar

An inline thumbs up/down banner that owns its own flow — asks, optionally collects a category and comment on a thumbs-down vote, then confirms with a thank-you — all in place, no modal.

  • Shadow DOM
  • 3 events
  • Optional detail form
  • Category chips
  • Customisable copy

Drop <kai-feedback-bar> after any response. The element transitions to a thank-you on vote; the × button fires kai-close and you control when the element leaves the DOM.

  • Copy — override any label via attributes: bar-title, detail-title, detail-placeholder, submit-label, thanks-message.
  • Detail form — add collect-detail to open a follow-up form on a thumbs-down vote. Set categories in JavaScript (it’s an array) to render selectable chips.

Override the question with bar-title when “Was this helpful?” doesn’t fit the context.

Add collect-detail for an optional follow-up form on a thumbs-down vote. Listen for kai-feedback-detail to receive { value, category?, comment? }.

Set the categories property alongside collect-detail to render selectable chips — fast tagging without typing.

Every label is overridable — override only what you need; the rest fall back to defaults.

PropertyTypeDefaultNotes
barTitle 'Was this helpful?' The banner label (e.g. "Was this helpful?"). Attribute: `bar-title` (`title` is avoided — it's a global HTML attribute).
collectDetail When set, a not-helpful vote opens an optional detail form before the thank-you confirmation. Attribute: `collect-detail`.
categories Optional category chips for the detail form. Set as a JS property (array).
detailTitle Heading for the detail form. Attribute: `detail-title`.
detailPlaceholder Placeholder for the detail comment box. Attribute: `detail-placeholder`.
submitLabel Submit button label in the detail form. Attribute: `submit-label`.
thanksMessage Confirmation copy shown after a vote/submit. Attribute: `thanks-message`.
EventDetailNotes
The user dismissed the banner.
The user rated the response. `value` is `'helpful'` or `'not-helpful'`.
The user submitted the optional detail form (`collect-detail`).

This element wraps these SolidJS components — reach for them directly when you need finer control than the props expose.

FeedbackBar