Skip to main content

Components

ValidationMessage

ValidationMessage is used to display feedback related to the validation of user input, such as error messages or warnings in forms.

asChild
Description

Change the default rendered element for the one passed as a child, merging their props and behavior.

Type
boolean
Default
false
NameTypeDefaultDescription
asChildbooleanfalse

Change the default rendered element for the one passed as a child, merging their props and behavior.

Usage

Examples

All colors

You switch between colors by setting the data-color attribute. This changes the icon.

CSS variables and data attributes

CSS Variables
NameValue
--dsc-validation-message-icon-urlurl("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M7.74 2.47a.75.75 0 0 1 .53-.22h7.46a.75.75 0 0 1 .53.22l5.27 5.27c.14.14.22.33.22.53v7.46a.75.75 0 0 1-.22.53l-5.27 5.27a.75.75 0 0 1-.53.22H8.27a.75.75 0 0 1-.53-.22l-5.27-5.27a.75.75 0 0 1-.22-.53V8.27a.75.75 0 0 1 .22-.53zm1.29 5.5a.75.75 0 0 0-1.06 1.06L10.94 12l-2.97 2.97a.75.75 0 1 0 1.06 1.06L12 13.06l2.97 2.97a.75.75 0 1 0 1.06-1.06L13.06 12l2.97-2.97a.75.75 0 0 0-1.06-1.06L12 10.94z'/%3E%3C/svg%3E")
--dsc-validation-message-icon-sizevar(--ds-size-7)
--dsc-validation-message-spacingvar(--ds-size-2)
--dsc-validation-message-colorvar(--ds-color-danger-text-subtle)

No relevant data attributes found.

Edit this page on github.com (opens in a new tab)