Skip to main content

error

Description

Optional. Defines whether error styling is applied to a time picker

Usage

error?: boolean;

Parameters

  • true - the error style is applied to the time picker
  • false - (default) the error style is not applied to the time picker

Example

<TimePicker error={true} />

Details

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

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

import { TimePicker, Field } from "@svar-ui/react-core";

<Field label="Error message" error={true}>
{({ id }) => (
<TimePicker id={id} error={true} />
)}
</Field>

Related article: Styling a time validation error

Related sample: TimePicker