tsimport {XDSFieldStatus} from '@xds/core/Field'
| Guidance | Practices |
|---|---|
| Do | Always provide a label for accessibility, even if visually hidden with isLabelHidden. |
| Do | Use the status prop with clear messages to provide inline validation feedback. |
| Do | Add a description when the label alone does not explain what the field expects, like format hints or constraints. |
| Don't | Set both isOptional and isRequired on the same field. |
| Don't | Use the detached status variant on bordered inputs — reserve it for checkboxes, switches, and sliders. |
| Don't | Hide the label without providing an alternative way for the user to understand the field purpose. |
tsx'use client';import {XDSFieldStatusComponent} from '@xds/core/Field';import {XDSVStack} from '@xds/core/Layout';export default function FieldStatusShowcase() {return (<XDSVStack gap={4}><XDSFieldStatusComponenttype="error"message="This field is required"variant="detached"/><XDSFieldStatusComponenttype="warning"message="This username is already taken by another team"variant="detached"/><XDSFieldStatusComponenttype="success"message="Your changes have been saved"variant="detached"/></XDSVStack>);}