# Rating slider with emoji feedback

> Rating slider with emoji feedback

A shadcn/ui block from the [@reui](https://reui.io) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/reui/c-slider-12).

- Page, with a live preview: https://shadcn.exchange/r/reui/c-slider-12
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-slider-12-light-aa5a20288ce67de9.png
- Registry item: https://reui.io/r/new-york-v4/c-slider-12.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://reui.io/r/new-york-v4/c-slider-12.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `label`, `slider`

## Files

### `c-slider-12.tsx`

```tsx
"use client"

import { useState } from "react"

import { Label } from "@/components/ui/label"
import { Slider } from "@/components/ui/slider"

const emojis = ["😡", "🙁", "😐", "🙂", "😍"]
const labels = ["Awful", "Poor", "Okay", "Good", "Amazing"]

export function Pattern() {
  const [value, setValue] = useState(3)

  return (
    <div className="mx-auto grid w-full max-w-sm gap-3">
      <Label className="text-sm font-medium">Rate your experience</Label>
      <div className="flex items-center gap-3">
        <Slider
          value={[value]}
          onValueChange={(val) =>
            setValue(Array.isArray(val) ? (val[0] ?? 3) : val)
          }
          min={1}
          max={5}
          step={1}
        />
        <span className="text-2xl" aria-hidden="true">
          {emojis[value - 1]}
        </span>
      </div>
      <span className="text-muted-foreground text-center text-xs font-medium">
        {labels[value - 1]}
      </span>
    </div>
  )
}
```
