Command Palette

Search for a command to run...

Docs
Sentiment Radio Group

Sentiment Radio Group

A radio group with sentiment cards featuring emojis, titles, and descriptions for feedback collection.

Loading...

Installation

Usage

import {
  RadioGroup,
  SentimentCard,
} from "@/components/ruixen/sentiment-radio-group";
 
export default function App() {
  return (
    <div className="space-y-4">
      <h2 className="text-lg font-semibold">How did it go?</h2>
 
      <RadioGroup defaultValue="neutral">
        <SentimentCard
          value="angry"
          emoji="😠"
          title="Angry"
          description="Frustrated or upset with the experience."
        />
        <SentimentCard
          value="sad"
          emoji="🙁"
          title="Sad"
          description="Something didn't meet expectations."
        />
        <SentimentCard
          value="neutral"
          emoji="😐"
          title="Neutral"
          description="Neither good nor bad, just okay."
        />
        <SentimentCard
          value="happy"
          emoji="🙂"
          title="Happy"
          description="Satisfied and had a good experience."
        />
        <SentimentCard
          value="delighted"
          emoji="😀"
          title="Delighted"
          description="Loved it, exceeded expectations!"
        />
      </RadioGroup>
    </div>
  );
}

Props

RadioGroup Props

PropTypeDefaultDescription
classNamestring-Additional CSS classes
defaultValuestring-Default selected value
valuestring-Controlled selected value
onValueChange(value: string) => void-Callback when value changes

SentimentCard Props

PropTypeDefaultDescription
valuestring-Unique value for this option
emojistring-Emoji character to display
titlestring-Card title text
descriptionstring-Optional description text
classNamestring-Additional CSS classes

Features

  • Sentiment Collection: Perfect for gathering user feedback and satisfaction ratings
  • Visual Feedback: Large emojis provide immediate visual context
  • Descriptive Text: Titles and descriptions help users understand each option
  • Accessible: Built on Radix UI primitives with proper keyboard navigation
  • Customizable: Easy to style and extend with additional sentiment options

Use Cases

  • Customer Feedback: Post-purchase or post-service satisfaction surveys
  • User Experience: Gathering feedback on app features or interactions
  • Content Rating: Rating articles, videos, or other content
  • Mood Tracking: Personal wellness or mood tracking applications
  • Event Feedback: Conference, workshop, or event satisfaction surveys