# Feedback face

A rating whose drawn face goes from grump to grin.

Also called: emoji rating, smiley rating, satisfaction rating.

> chatcn Pro: needs a Pro license (https://chatcn.dev/pro). Install from the `@chatcn-pro` registry with your license token; setup at https://chatcn.dev/docs/chatcn-pro.

Example: A face that is the rating. Drag the slider and the face goes from grump to grin, tilting with your speed while the label rolls; send it and it winks. Preview: https://chatcn.dev/preview/feedback-face-demo

Drag the slider and a drawn face goes from grump to grin: the lids lift, the brows arch, the mouth opens, the cheeks warm and the face itself warms in colour, tilting with how fast you drag and bobbing as the label rolls to the next word. It blinks now and then. Send it and the face winks and the words thank you. Good for rating an agent's run or an answer.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/feedback-face
```

## Usage

```tsx
import { FeedbackFace } from "@/components/ui/chatcn/pro/feedback-face"

<FeedbackFace title="How did the agent do?" onSubmit={(rating) => rate(run.id, rating)} />
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `value` / `defaultValue` / `onValueChange` | `number` | 0 to 4 |
| `labels` | `string[5]` | Worst to best |
| `title` / `context` | `ReactNode` |  |
| `thanks` | `{ title, label }` | Once sent |
| `submitted` / `onSubmit` |  |  |

## Keyboard

| Key | Action |
| --- | --- |
| `Arrow keys` | One step worse or better |

## Accessibility

- A slider with each label as its value text; the label line is announced.

## Motion

- The face eases to each value; tilt and bob ride springs. Reduced motion: the face changes without tilting or blinking.

Source: https://chatcn.dev/docs/components/feedback-face