Skip to content

VSimpleColorPicker

Props

NameTypeDescription
anchorEnum:
string
HTMLElement
ID or direct reference to the component's anchor element.
disabledbooleanSets the element's disabled state. A disabled element will not be included during form submission.
initial-valuestringThe default value of the element. This value sets the value property only when the value property has not been explicitly set.
labelstringThe label for the form element.
namestringThe name of the element. This element's value will be surfaced during form submission under the provided name.
openbooleanIndicates whether the popup is open
placementEnum:
top
bottom
left
right
top-start
top-end
bottom-start
bottom-end
left-end
left-start
right-end
right-start
Preferred placement of the Color Picker's popup in relation to the anchor element
requiredbooleanRequire the field to be completed prior to form submission.
swatches{label?: string; value: string}[]List of color swatches, has to be an array of objects
swatches-per-rownumberNumber of swatches per row for grid layout
valuestringThe current value of the element.

Events

NameEvent TypeDescription
changeCustomEvent<undefined>Fires when the value changes
inputEventFires when the value of the element changes.

Slots

NameDescription
anchorSlot for attaching the toggle button

Methods

NameTypeDescription
checkValidity() => booleanReturn the current validity of the element.
reportValidity() => booleanReturn the current validity of the element. If false, fires an invalid event at the element.