Skip to main content

error

Description

defines whether error styling is applied to a color picker

Type

boolean

Default value

false

Example

<ColorPicker error={true}/>

Details

The property is useful during a form validation. If the property is set to true the color picker gets error styling: the input's border and the color's value become red.

To add a red error label for the control, use the error property of the Field control:

<script>
import { ColorPicker, Field } from "wx-svelte-core";
</script>

<Field label="Error message" error={true}>
{#snippet children(id)}
<ColorPicker {id} error={true}/>
{/snippet}
</Field>

Related article: Styling a color validation error

Related sample: ColorPicker