ColorPickerEdit
Colour edit panel for OrigamColorPicker. Renders a row of text inputs for the active colour mode (RGB, RGBA, HSL, HSLA, HEX, HEXA) and a cycle button to switch between enabled modes.
Preview
Rendering the live preview…
rgba modeRendering the live preview…
hex modeRendering the live preview…
disabledStructure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-color-picker-edit> — 4 internal parts. Each mode channel gets a __field ② wrapper containing an __input ③ (native <input>) and a __label ④. The cycle button (origam-btn) appears only when more than one mode is enabled.- 1.origam-color-picker-edit
- Root element. flex row — channels sit inline. The cycle button appends at the end.
- 2.origam-color-picker-edit__field
- Per-channel wrapper. flex column + text-align: center. Full-width with margin-inline-end between siblings.
- 3.origam-color-picker-edit__input
- Native element for the channel value. onChange triggers update:colorHsv after mode conversion.
- 4.origam-color-picker-edit__label
- Channel label below the input (e.g. "R", "G", "B", "A", "#"). Font-size 0.75rem.
API
Props
All props accepted by this component, with their type, default value and description.
- colorHsvTHSVA | null
- Current colour in HSVA format ({ h, s, v, a }). The component converts to the active mode for display and re-converts on user input.
- disabledbooleanfalse
- Disables all text inputs. Prevents user from editing the colour values.
- modeTColorModesCOLOR_MODES_NAMES.RGBA
- Currently active colour mode. Determines which input fields are displayed (e.g. R/G/B/A for RGBA, H/S/L for HSL, #hex for HEX).
- modesArray<TColorModes>['rgb', 'rgba', 'hsl', 'hsla', 'hex', 'hexa']
- List of allowed colour modes. The cycle button only appears when more than one mode is enabled.
- ariaLabelstring
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
API
Emits
Events emitted by this component.
- @update:colorHsvTHSVA
- Fired when the user edits a field. Emits the converted THSVA value so the parent updates the colour.
- @update:modeTColorModes
- Fired when the cycle button is clicked. Emits the next mode in the enabled modes list.
API
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- <T extends object>(props: T, exclude?: string[]) => Partial<T>
- Utility to forward a filtered subset of props to a child component.
- Ref<string>
- Reactive CSS string generated by useStyle.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet. Called on mount.
- () => void
- Removes the injected style sheet. Called on unmount.
- Ref<boolean>
- True once the style sheet has been injected into the DOM.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Width of each channel input field.
- Gap between channel fields.
- Colour of the channel label text (R, G, B, A, #).
- Font size of the channel label.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Moves focus between channel inputs and the cycle button. |
| Enter | Commits the typed value in the focused channel input (native input onChange). |
Notes
- Each input is paired with a visible channel label (R, G, B, A, #…). Consumers should provide an accessible aria-label or wrap in a <fieldset><legend> when embedding standalone.
- When disabled=true, the native disabled attribute is set on every input, preventing keyboard and pointer interaction.
- The mode cycle button (origam-btn) has an icon only — always pair with an aria-label on the parent ColorPicker or provide a tooltip.
Foundation
Design tokens
Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.
- dimensionvar(--origam-space---2)
- Gap between fields.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Standalone edit panel
HEX mode only