FieldError is an essential component for displaying error messages in forms in Arkyn. It provides clear and accessible visual feedback about validation issues, maintaining consistency in error presentation and intelligent conditional rendering.FieldError should not be used with the native components in @arkyn/components, as these already have FieldError built-in.tsx
import { FieldError } from "@arkyn/components";
tsx
<FieldError>This field is required</FieldError>
FieldError only renders when it has content, avoiding empty elements in the DOM.tsx
/* ✅ Renders - has content */<FieldError>This field is required</FieldError>;/* ❌ Does not render - empty string */<FieldError></FieldError>;/* ❌ Does not render - null */<FieldError>{null}</FieldError>;/* ❌ Does not render - undefined */<FieldError>{undefined}</FieldError>;
children - ReactNode
Error message content (text, elements, etc.)className - string
Additional CSS classes for custom stylingstrong element,
including onClick, onFocus, style, data-, aria-, etc.<strong> to give semantic importance to the error