Command Palette

Search for a command to run...

Docs
Color Emotion Select

Color Emotion Select

A select component that displays options with color indicators and optional emojis for emotional context.

Installation

Usage

import { ColorEmotionSelect } from "@/components/ruixen/color-emotion-select";
 
const moodOptions = [
  { value: "happy", label: "Happy", color: "#22c55e", emoji: "😊" },
  { value: "sad", label: "Sad", color: "#3b82f6", emoji: "😢" },
  { value: "angry", label: "Angry", color: "#ef4444", emoji: "😠" },
  { value: "excited", label: "Excited", color: "#f59e0b", emoji: "🤩" },
];
 
export function MoodSelector() {
  return (
    <ColorEmotionSelect
      options={moodOptions}
      label="How are you feeling?"
      placeholder="Select your mood..."
      onChange={(value) => console.log("Selected:", value)}
    />
  );
}

Props

PropTypeDefaultDescription
optionsColorEmotionOption[]-Array of options with value, label, color, and optional emoji
labelstring-Optional label for the select group
placeholderstring"Select..."Placeholder text when no option is selected
onChange(value: string) => void-Callback function when selection changes
defaultValuestring-Default selected value

ColorEmotionOption

PropertyTypeDescription
valuestringThe value of the option
labelstringDisplay text for the option
colorstringColor indicator (Tailwind color or hex)
emojistringOptional emoji for visual context

Examples

Basic Usage

Priority Levels

const priorityOptions = [
  { value: "low", label: "Low Priority", color: "#22c55e" },
  { value: "medium", label: "Medium Priority", color: "#f59e0b" },
  { value: "high", label: "High Priority", color: "#ef4444" },
  { value: "critical", label: "Critical", color: "#dc2626" },
]
 
<ColorEmotionSelect
  options={priorityOptions}
  label="Task Priority"
  placeholder="Select priority level..."
/>

Status Indicators

const statusOptions = [
  { value: "active", label: "Active", color: "#10b981", emoji: "✅" },
  { value: "pending", label: "Pending", color: "#f59e0b", emoji: "⏳" },
  { value: "inactive", label: "Inactive", color: "#6b7280", emoji: "⏸️" },
  { value: "error", label: "Error", color: "#ef4444", emoji: "❌" },
]
 
<ColorEmotionSelect
  options={statusOptions}
  placeholder="Select status..."
/>