Interface ThumbsFeedbackBlockProps

Creates a thumbs feedback component for user feedback collection.

Displays two buttons (thumbs up and thumbs down) that users can click to provide feedback.

Configuration object

The name of the thumbs feedback component in the state

Callback function called when thumbs up is clicked

Callback function called when thumbs down is clicked

Whether the component is disabled

Additional CSS class name

A JSX element representing the thumbs feedback component

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'
});
}
})
])
]);
interface ThumbsFeedbackBlockProps {
    buttonTexts?: {
        dismiss?: string;
    };
    className?: string;
    disabled?: boolean;
    name?: string;
    onDismissClick?: (() => void);
    onThumbsDownClick?: (() => void);
    onThumbsUpClick?: (() => void);
    resolve?: boolean;
}

Hierarchy

  • Omit<ThumbsFeedbackProps, "resolve">
    • ThumbsFeedbackBlockProps

Properties

buttonTexts?: {
    dismiss?: string;
}

Button texts

className?: string

Custom CSS class name

disabled?: boolean

Whether the component is disabled

name?: string

Optional name for state management

onDismissClick?: (() => void)

Callback when dismiss is clicked

onThumbsDownClick?: (() => void)

Callback when thumbs down is clicked

onThumbsUpClick?: (() => void)

Callback when thumbs up is clicked

resolve?: boolean

Whether the component should resolve the UI when a button is clicked. Defaults to true.