Color Input
wednesday-ui/color-inputFreeComponent
A color input component
Install it
npx shadcn@latest add https://ui.ednesdayw.com/r/color-input.jsonSource
1"use client";23import { cn } from "@/lib/utils";4import { ColorPicker } from "@/components/ui/color-picker";5import { Input, type InputProps } from "@/components/ui/input";67interface ColorInputProps8 extends Omit<InputProps, "value" | "onChange" | "startContent"> {9 type?: "hex" | "hex-alpha";10 value: string;11 onChange: (value: string) => void;12}1314const ColorInput = ({15 variant,16 className,17 value = "#4ec4b8",18 type = "hex",19 onChange,20 ...props21}: ColorInputProps) => {22 return (23 <Input24 {...props}25 variant={variant}26 className={cn("p-2", className)}27 value={value}28 onChange={(e) => {29 const value = e.target.value;30 onChange(value);31 }}32 startContent={33 <ColorPicker34 type={type}35 sideOffset={16}36 alignOffset={variant === "underline" ? -4 : -12}37 value={value}38 onChange={(value) => {39 onChange(value);40 }}41 />42 }43 />44 );45};4647export { ColorInput, type ColorInputProps };
What it pulls in
Other registry items
Files it writes
More from Wednesday UI
All 99 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Autocompleteautocomplete | Wednesday UI | Components | Free | 1 dep | |
| Autocomplete Disabled Demoautocomplete-disabled-demo | Wednesday UI | Components | Free | no deps | |
| Autocomplete Disabled Item Demoautocomplete-disabled-item-demo | Wednesday UI | Components | Free | no deps | |
| Autocomplete Form Demoautocomplete-form-demo | Wednesday UI | Components | Free | no deps | |
| Autocomplete Invalid Demoautocomplete-invalid-demo | Wednesday UI | Components | Free | no deps | |
| Autocomplete Size Demoautocomplete-size-demo | Wednesday UI | Components | Free | no deps | |
| Autocomplete Start Content Demoautocomplete-start-content-demo | Wednesday UI | Components | Free | no deps | |
| Autocomplete Variant Demoautocomplete-variant-demo | Wednesday UI | Components | Free | no deps |
