Color Input
A native text input for theme seed colors with Kikita picker affordances.
Use the directive on a native input, usually inside a Kikita field.
import { KuiColorInputDirective, KuiFieldComponent } from '@kikita-labs/ui';Keep the native input as the form source of truth and let the swatch open the picker.
<div class="basic-color-input-example">
<kui-field label="Primary seed" hint="Hex and OKLCH values are supported.">
<input
kuiColorInput
value="#5b4fe0"
autocomplete="off"
swatchLabel="Open primary seed color picker"
/>
</kui-field>
</div>Inputs verified against @kikita-labs/ui v1.6.1 public typings.
| Name | Type | Default | Description |
|---|---|---|---|
| kuiColorInput | directive | - | Applies Kikita color-input styling and picker affordances to a native input. |
| size | 'xs' | 'sm' | 'md' | 'lg' | 'md' | Control height matched to Kikita UI size tokens. |
| invalid | boolean | false | Applies an error border and inherits invalid state from parent kui-field. |
| id | string | undefined | field id | Native input id override. |
| swatchLabel | string | 'Open color picker' | Accessible label for the swatch button. |
The editable value remains a native text input, while picker triggers are native buttons.
- Use
kui-fieldfor label, hint, error, and described-by wiring. - Unsupported non-empty values expose invalid state on the wrapper.
- Disabled and readonly native attributes also disable the swatch button.
- Test the picker popover manually on narrow screens before releasing visual changes.