Skip to content

Button interaction on AI UI kit #4066

Answered by dosubot bot
tonge495 asked this question in General
Discussion options

You must be logged in to vote

The active state for the thumbs up/down feedback buttons should be based on the front end rendering as shown in the FullAIMessage component. This component uses the pressed attribute to indicate the active state of the buttons.

<Button
  variant="secondary_icon"
  aria-label="this is a helpful response"
  size="reset"
  pressed={liked}
  onClick={() => {
    setLiked(!liked);
    setDisliked(false);
  }}
>
  <ThumbsUpIcon decorative={false} title="like result" />
</Button>
<Button
  variant="secondary_icon"
  aria-label="this is not a helpful response"
  size="reset"
  pressed={disliked}
  onClick={() => {
    setDisliked(!disliked);
    setLiked(false);
  }}
>
  <ThumbsDownIcon decorative=

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tonge495
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants