Skip to main content

error

Description

defines whether error styling is applied to a date range picker

Type

boolean

Default value

false

Example

<DateRangePicker error={true}/> 

Details

The property is useful during a form validation. If the property is set to true(or just specified without a value) and the input value fails validation, the date range picker gets error styling: the input's border and the option's value become red.

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

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

<Field label="Error" error let:id>
<DaterRangePicker {id} error={true}/> <!-- equals to <DateRangePicker {id} error/> -->
</Field>

Related article: Styling a date range validation error

Related sample: DateRangePicker