跳到主要内容

ILabel

Field name in the form.

labellabel

Examples​

Required field label with inline display

const emailLabel: ILabel = {
text: "Email Address",
isRequired: true,
error: false,
title: "Enter your email address",
htmlFor: "email-input",
display: "flex"
}

Error state label with truncation and block display

const longFieldLabel: ILabel = {
text: "Document Processing Configuration Settings",
isRequired: false,
error: true,
truncate: true,
title: "Configure document processing settings",
htmlFor: "doc-settings",
display: "block"
}

Properties​

PropertyTypeDescription
textstringDefines the element text
isRequiredbooleanSpecifies whether the field to which the label is attached is required
errorbooleanSpecifies whether the field to which the label is attached is incorrect
titlestringDefines the label title
truncatebooleanSpecifies whether the word wrapping is disabled
htmlForstringDefines the field ID to which the label is attached
displaystringSpecifies whether the "display" property is set
classNamestringDefines the CSS class for styling the component. Can be used to override or extend the default component styles.