Field reference

Color field

A color picker that stores a CSS color value.

#Field definition

Add this array inside a block, field group, or option page fields list.

PHP
['field_key' => 'accent_color', 'label' => 'Accent color', 'type' => 'color', 'default_value' => '#1d49c3']

#Saved value

PropertyValue
Field typecolor
PHP / REST valuestring
Empty value"" or the configured default

#Rendering example

Read block fields from $attributes. Post fields use voxycure_get_field(); option fields use voxycure_get_option().

PHP
$value = $attributes['accent_color'] ?? '';
echo esc_html(is_array($value) ? implode(', ', $value) : (string) $value);

#Common field options

KeyTypePurpose
field_keystringRequired unique storage key using lowercase letters, numbers, underscores, or hyphens.
labelstringHuman-readable editor label.
default_valuemixedValue used before content is saved. Match the field value type.
requiredbooleanRejects an empty option-page submission.
conditional_logicarrayControls editor visibility based on another field.
locationstringdefault or inspector for block fields.
Framework version2.0.0
PHP requirement8.0+
Documentation updatedAugust 2026