This component no longer exists. It was in abui’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-06 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
Color Swatch Selector
abui/color-swatch-selectorRemovedComponent
A color swatch selector component.
Live preview
live · rendered by the registry
Rendered by abui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://abui.io/r/color-swatch-selector.jsonSource
1"use client"23import * as React from "react"4import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"56import { cn } from "@/lib/utils"78function ColorSwatchSelectorRoot({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {9 return (10 <RadioGroupPrimitive.Root11 data-slot="color-swatch-selector-root"12 className={cn(13 "flex items-center justify-between gap-4 py-3 bg-muted dark:bg-muted/60 p-3 pl-5 rounded-full",14 className,15 )}16 {...props}17 />18 )19}2021interface ColorSwatchSelectorLabelProps extends React.HTMLAttributes<HTMLDivElement> {22 value: string23}2425function ColorSwatchSelectorLabel({ className, value, ...props }: ColorSwatchSelectorLabelProps) {26 return (27 <div28 data-slot="color-swatch-selector-label"29 className={cn("text-base font-normal leading-none", className)}30 {...props}31 >32 {value}33 </div>34 )35}3637function ColorSwatchSelectorContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {38 return (39 <div data-slot="color-swatch-selector-content" className={cn("flex items-center gap-2", className)} {...props} />40 )41}4243interface ColorSwatchSelectorItemProps extends React.ComponentProps<typeof RadioGroupPrimitive.Item> {44 value: string45}4647function ColorSwatchSelectorItem({ className, value, ...props }: ColorSwatchSelectorItemProps) {48 return (49 <RadioGroupPrimitive.Item50 data-slot="color-swatch-selector-item"51 value={value}52 className={cn(53 "group relative h-8 w-8 shrink-0 cursor-pointer rounded-full outline-none transition-all",54 "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",55 "disabled:cursor-not-allowed disabled:opacity-50",56 className,57 )}58 style={{ backgroundColor: value, boxShadow: `1px 3px 4px 0px rgba(0, 0, 0, 0.25) inset` }}59 {...props}60 >61 {/* Selected indicator - white ring in the center */}62 <div63 className={cn(64 "absolute inset-0 flex items-center justify-center",65 "transition-all duration-200",66 "opacity-0 scale-0",67 "group-data-[state=checked]:opacity-100 group-data-[state=checked]:scale-100",68 )}69 >70 <div className="h-4 w-4 rounded-full border-[3px] bg-background" />71 </div>72 </RadioGroupPrimitive.Item>73 )74}7576export const ColorSwatchSelector = {77 Root: ColorSwatchSelectorRoot,78 Label: ColorSwatchSelectorLabel,79// … truncated
