Component
Color input
<DomColorInput>Native colour picker paired with a hex text field — both bound to the same value.
Playground
Try every prop live
Color input playground
Edit props in the inspector — picker and hex field share the same value.
Used for accents and links.
Playground.vuevue
<script setup>
import { reactive } from 'vue';
import { DomColorInput } from '@getdom/studio/vue';
const data = reactive({
"modelValue": "#3b82f6",
"id": "",
"name": "",
"label": "Brand colour",
"description": "Used for accents and links.",
"placeholder": "",
"required": false,
"disabled": false,
"readOnly": false,
"invalid": false,
"errors": {},
"visible": true,
"validators": [],
"validateOnBlur": true,
"chrome": "field"
});
</script>
<template>
<DomColorInput
v-bind="data"
@update:modelValue="data.modelValue = $event"
/>
</template>Demo
Live preview
Used for primary buttons and links.
#0ea5e9Usage
Vue
<script setup>
import { DomColorInput } from '@getdom/studio/vue';
import { ref } from 'vue';
const accent = ref('#0ea5e9');
</script>
<template>
<DomColorInput
v-model="accent"
label="Accent colour"
description="Used for primary buttons and links."
/>
</template>Reference
Props
Control props
| Name | Type | TS | Default | Description |
|---|---|---|---|---|
modelValue | string | string | '#000000' | Hex colour value. |
Field props
| Name | Type | TS | Default | Description |
|---|---|---|---|---|
id | string | string | '' | Optional ID override. By default parent forms derive the input ID from the field path using underscores. |
name | string | string | '' | Local field name. Parent forms derive the full field path and native HTML name from the form hierarchy. |
label | string | string | '' | Visible field label. |
description | string | string | '' | Optional helper copy below the field. |
placeholder | string | string | '' | Placeholder shown when the control is empty. |
required | boolean | boolean | false | Mark the field as required. |
disabled | boolean | boolean | false | Disable field interaction. |
readOnly | boolean | boolean | false | Show the value but prevent editing. |
invalid | boolean | boolean | false | Mark the field invalid. |
errors | array | object | string | Array< | {} | Validation errors for this field. |
visible | boolean | boolean | true | Show or hide the field. |
validators | array | Array<unknown> | [] | Validators attached to this field. Use functions in Vue code, or serializable records such as { name: "minLength", props: { min: 2 } } in generated schemas. |
validateOnBlur | boolean | boolean | true | Run validators when the field loses focus. |
chrome | 'field' | false | string | 'field' | Render default field chrome, or false to render only the control while keeping form state wiring. |
Auto-generated from Color input.props and inline _edit hints.