Skip to main content

error

Description

Optional. Defines whether error styling is applied to the Text control

Usage

error?: boolean;

Parameters

  • true - error styling is applied to the Text control
  • false - (default) error styling is not applied

Example

<Text :error="true"/>

Details

The property is useful during a form validation. If the property is set to true a text control gets error styling: the input's borders and the entered text become red.

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

<script setup>
import { Text, Field } from "@svar-ui/vue-core";
</script>

<template>
<Field label="Error message" :error="true">
<Text :error="true"/>
</Field>
</template>

Related article: Styling a validation error

Related sample: Text Inputs