Appearance
Interface: ThumbsFeedbackBlockProps
Defined in: src/UI/blocks/thumbsFeedback.tsx:67
Thumbs feedback component for user feedback collection. Displays two buttons (thumbs up and thumbs down) that users can click to provide feedback.
Param
Configuration object
Param
Name of the thumbs feedback component in the state
Param
Callback function called when thumbs up is clicked
Param
Callback function called when thumbs down is clicked
Param
Whether the component is disabled
Param
Additional CSS class name
Examples
Basic usage
thumbsFeedback({
name: 'userFeedback',
onThumbsUpClick: () => console.log('Thumbs up!'),
onThumbsDownClick: () => console.log('Thumbs down!')
});Usage with disabled state
thumbsFeedback({
name: 'feedback',
disabled: true,
onThumbsUpClick: () => {},
onThumbsDownClick: () => {}
});Usage inside a group for feedback in success states
bubble([
group([
completion({
title: 'Task completed successfully',
description: 'All operations have been completed.'
}),
thumbsFeedback({
name: 'feedback',
onThumbsUpClick: async () => {
await ctx.telemetry?.sendEvent('THUMBS_FEEDBACK', {
feedback: 'ThumbsUpFeedback'
});
},
onThumbsDownClick: async () => {
await ctx.telemetry?.sendEvent('THUMBS_FEEDBACK', {
feedback: 'ThumbsDownFeedback'
});
}
})
])
]);Extends
Omit<ThumbsFeedbackProps,"resolve">
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
resolve? | boolean | Whether the component should resolve the UI when a button is clicked. Defaults to true. | - | src/UI/blocks/thumbsFeedback.tsx:70 |
name? | string | Optional name for state management | Omit.name | src/assistant-ui/components/mw/ThumbsFeedback/types.ts:8 |
onDismissClick? | () => void | Callback when dismiss is clicked | Omit.onDismissClick | src/assistant-ui/components/mw/ThumbsFeedback/types.ts:10 |
onThumbsUpClick? | () => void | Callback when thumbs up is clicked | Omit.onThumbsUpClick | src/assistant-ui/components/mw/ThumbsFeedback/types.ts:12 |
onThumbsDownClick? | () => void | Callback when thumbs down is clicked | Omit.onThumbsDownClick | src/assistant-ui/components/mw/ThumbsFeedback/types.ts:14 |
disabled? | boolean | Whether the component is disabled | Omit.disabled | src/assistant-ui/components/mw/ThumbsFeedback/types.ts:16 |
className? | string | Custom CSS class name | Omit.className | src/assistant-ui/components/mw/ThumbsFeedback/types.ts:18 |
buttonTexts? | { dismiss?: string; } | Button texts | Omit.buttonTexts | src/assistant-ui/components/mw/ThumbsFeedback/types.ts:22 |
buttonTexts.dismiss? | string | - | - | src/assistant-ui/components/mw/ThumbsFeedback/types.ts:23 |