A select component that displays options with color indicators and optional emojis for emotional context.
Install
Add it to your project
Run this in a project set up for shadcn/ui. It writes the files and installs the npm packages.
First time: connect the Infinity UI registry
- Create a personal token on your Tokens page.
- Put it in
.env.localasINFINITYUI_TOKEN. - Add the registry to
components.json:
{
"registries": {
"@infinityui": {
"url": "https://infinityui.io/r/{name}.json",
"headers": {
"Authorization": "Bearer ${INFINITYUI_TOKEN}"
}
}
}
}Using Claude Code, Codex, Cursor, Lovable or v0? See CLI & MCP for a setup prompt.
Code
"use client";
import * as React from "react";
import {
ColorEmotionSelect,
ColorEmotionOption,
} from "@/registry/ruixenui/color-emotion-select";
const moodOptions: ColorEmotionOption[] = [
{ value: "happy", label: "Happy", color: "#FFD700", emoji: "😄" },
{ value: "sad", label: "Sad", color: "#1E3A8A", emoji: "😢" },
{ value: "angry", label: "Angry", color: "#DC2626", emoji: "😡" },
{ value: "neutral", label: "Neutral", color: "#9CA3AF", emoji: "😐" },
];
export default function DemoColorEmotionSelect() {
const [selectedMood, setSelectedMood] = React.useState<string | undefined>();
return (
<div className="p-4 flex flex-col gap-4 min-h-screen items-center justify-center">
<ColorEmotionSelect
options={moodOptions}
label="Select Your Mood"
placeholder="Choose mood"
onChange={setSelectedMood}
defaultValue={selectedMood}
/>
{selectedMood && (
<p className="text-sm text-gray-700">
You selected: <span className="font-semibold">{selectedMood}</span>
</p>
)}
</div>
);
}
































