跳到主要内容

ILabel

View source on GitHub

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
isRequired?booleanSpecifies whether the field to which the label is attached is required
error?booleanSpecifies whether the field to which the label is attached is incorrect
title?stringDefines the label title
truncate?booleanSpecifies whether the word wrapping is disabled
htmlFor?stringDefines the field ID to which the label is attached
display?stringSpecifies whether the "display" property is set
className?stringDefines the CSS class for styling the component. Can be used to override or extend the default component styles.