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
widgetIdYesWidget source id (wgt_…)
openYesControlled open state
onOpenChangeYesCalled when the dialog should open/close
contextNoFree-form product context stored with the submission
titleNoSDK defaultDialog title
descriptionNoSDK defaultHelper text
defaultSentimentNoInitial 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
classNameNoClass on the dialog root
onSubmittedNoCalled after a successful submit
onErrorNoCalled 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
widgetIdYesWidget source id (wgt_…)
contextNoFree-form product context
classNameNoClass on the control root
labelNo"Was this helpful?"Accessible label for the control group
onSubmittedNoAfter successful submit (positive | negative)
onErrorNoError 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.