Deck Docs

Built-in components

FeedbackDialog and ThumbsFeedback props and behavior.

Built-in components

Optional UI included in @deck-io/feedback. Skip these when you use headless submit with your own design system.

Both components require a parent DeckProvider.

FeedbackDialog

Controlled modal for written feedback. Your app owns the open/close trigger and open state.

const [open, setOpen] = useState(false);

<button type="button" onClick={() => setOpen(true)}>
  Share feedback
</button>

<FeedbackDialog
  widgetId="wgt_your_widget_id"
  open={open}
  onOpenChange={setOpen}
  context={{ surface: "settings" }}
  title="How are we doing?"
  onSubmitted={({ sentiment, message }) => {
    // toast, analytics, etc.
  }}
  onError={(error) => {
    console.error(error);
  }}
/>

Props

PropRequiredDefaultDescription
widgetIdYes—Widget source id (wgt_…)
openYes—Controlled open state
onOpenChangeYes—Called when the dialog should open/close
contextNo—Free-form product context stored with the submission
titleNoSDK defaultDialog title
descriptionNoSDK defaultHelper text
defaultSentimentNo—Initial sentiment when opened (e.g. from thumbs)
messageOptionalNofalseWhen false, message is required. Thumbs flow typically sets true.
confirmTextNoSDK defaultPrimary button label
cancelTextNoSDK defaultSecondary button label
classNameNo—Class on the dialog root
onSubmittedNo—Called after a successful submit
onErrorNo—Called with an error string on failure

Sentiment options in the dialog: negative, neutral, positive.

ThumbsFeedback

Like / dislike control that opens FeedbackDialog with sentiment pre-filled. Message is optional after thumbs so completion stays high.

<ThumbsFeedback
  widgetId="wgt_your_widget_id"
  context={{ messageId: "msg_123" }}
  label="Was this helpful?"
  onSubmitted={({ sentiment, message }) => {
    // optional follow-up
  }}
/>

Props

PropRequiredDefaultDescription
widgetIdYes—Widget source id (wgt_…)
contextNo—Free-form product context
classNameNo—Class on the control root
labelNo"Was this helpful?"Accessible label for the control group
onSubmittedNo—After successful submit (positive | negative)
onErrorNo—Error callback

Choosing a pattern

PatternUse when
FeedbackDialog onlyYou want a “Share feedback” entry point with full sentiment + message
ThumbsFeedbackInline quality signal (e.g. under an AI answer)
BothDifferent surfaces, same widget or different widget ids
NeitherCustom UI via headless

Next

Headless submit for fully custom forms.