Skip to main content

error

Description

Optional. Defines whether error styling is applied to a date range picker

Usage

error?: boolean;

Parameters

  • true - error styling is applied
  • false - (default) error styling is not applied

Example

<DateRangePicker error={true}/> 

Details

The property is useful during a form validation. If the property is set to truethe 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 "@svar-ui/svelte-core";
</script>

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

Related article: Styling a date range validation error

Related sample: DateRangePicker