lg-chat Message Rating
npm install @lg-chat/message-rating``shell`
pnpm add @lg-chat/message-rating
`shell`
yarn add @lg-chat/message-rating
`shell`
npm install @lg-chat/message-rating
`tsx
import { useState, ChangeEvent } from 'react';
import {
MessageRating,
type MessageRatingProps,
MessageRatingValue,
} from '@lg-chat/message-rating';
const Example = () => {
const [value, setValue] = useState
MessageRatingValue.Unselected,
);
const handleRatingChange = (e: ChangeEvent
setValue(e.target.value as MessageRatingProps['value']);
};
return
};
`
| Prop | Type | Description | Default |
| ---------------- | -------------------------------------------- | ------------------------------------------------------------------------------ | ------- |
| darkMode | boolean | Determines if the component is rendered in dark mode | false |hideThumbsDown
| | boolean | Hides the thumbs down button | false |hideThumbsUp
| | boolean | Hides the thumbs up button | false |onChange
| | React.ChangeEventHandler | Event handler called when the value of the underlying radio inputs are changed | |value
| | 'liked' \| 'disliked' \| 'unselected' | Determines the currently selected value of the radio buttons | |...
| | HTMLElementProps<'div'>` | Props spread on root element | |