Color Picker
nexvyn/color-pickerFreeComponent
A blossom-style color picker with concentric petal layers, circular color bar, and arc slider for lightness control.
Live preview
live · rendered by the registry
Rendered by nexvyn on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.nexvyn.dev/r/color-picker.jsonSource
1'use client'23import { forwardRef, useEffect, useRef, type HTMLAttributes, type Ref } from 'react'45import { cn } from '@/lib/utils'6import {7 BlossomColorPicker as LocalBlossomColorPicker,8 type BlossomColorPickerOptions,9} from './blossom picker/BlossomColorPicker'10import { DEFAULT_COLORS, INNER_COLORS, OUTER_COLORS } from './blossom picker/constants'11import { blossomPickerStyles } from './blossom picker/styles'12import type {13 BlossomColorPickerColor,14 BlossomColorPickerValue,15 ColorInput,16 SliderPosition,17} from './blossom picker/types'18import {19 createColorOutput,20 getVisualSaturation,21 hexToHsl,22 hslToHex,23 hslToRgb,24 hslToString,25 hslaToString,26 lightnessToSliderValue,27 organizeColorsIntoLayers,28 parseColor,29 rgbaToString,30 rgbToHsl,31 sliderValueToLightness,32} from './blossom picker/utils'3334export type BlossomPickerVariant = 'blossom' | 'blossom-arc'3536export type BlossomPickerValue = BlossomColorPickerValue37export type BlossomPickerColor = BlossomColorPickerColor38export type { ColorInput, SliderPosition }3940export interface BlossomPickerProps41 extends42 Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue' | 'value'>,43 BlossomColorPickerOptions {44 variant?: BlossomPickerVariant45}4647export type { BlossomColorPickerValue, BlossomColorPickerColor, BlossomColorPickerOptions }48export type ColorPickerProps = BlossomPickerProps4950function propsToOptions(props: BlossomPickerProps): Partial<BlossomColorPickerOptions> {51 const options: Partial<BlossomColorPickerOptions> = {}5253 if (props.value !== undefined) options.value = props.value54 if (props.defaultValue !== undefined) options.defaultValue = props.defaultValue55 if (props.colors !== undefined) options.colors = props.colors56 if (props.onChange !== undefined) options.onChange = props.onChange57 if (props.onCollapse !== undefined) options.onCollapse = props.onCollapse58 if (props.disabled !== undefined) options.disabled = props.disabled59 if (props.openOnHover !== undefined) options.openOnHover = props.openOnHover60 if (props.initialExpanded !== undefined) {61 options.initialExpanded = props.initialExpanded62 }63 if (props.animationDuration !== undefined) {64 options.animationDuration = props.animationDuration65 }66 if (props.showAlphaSlider !== undefined) {67 options.showAlphaSlider = props.showAlphaSlider68 }69 if (props.coreSize !== undefined) options.coreSize = props.coreSize70 if (props.petalSize !== undefined) options.petalSize = props.petalSize71// … truncated
Files it writes
More from nexvyn
All 40 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | nexvyn | Components | Free | 1 dep | |
| Action Buttonaction-button | nexvyn | Components | Free | 3 deps · 4 files | |
| Adaptive Actionsadaptive-actions | nexvyn | Components | Free | 1 dep | |
| AI Inputai-input | nexvyn | Components | Free | 1 dep · 2 files | |
| Badgebadge | nexvyn | Components | Free | 2 deps · 2 files | |
| Bars Themebars-theme | nexvyn | Components | Free | 1 dep · 3 files | |
| Bounce Sidebarbounce-sidebar | nexvyn | Components | Free | 1 dep · 2 files | |
| Breadcrumbsbreadcrumbs | nexvyn | Components | Free | 1 dep · 2 files |
