FieldWrapper is a fundamental container component for organizing form fields in Arkyn. It provides a consistent structure, accessibility, and different layout orientations for grouping elements related to a field (label, input, error message).FieldWrapper should not be used with the native components in @arkyn/components, as these already have the FieldWrapper integrated internally.tsx
import { FieldWrapper } from "@arkyn/components";
tsx
<FieldWrapper><FieldLabel htmlFor="username">Username</FieldLabel><input id="username" name="username" placeholder="Enter your name" /><FieldError>This field is mandatory</FieldError></FieldWrapper>
tsx
<FieldWrapper orientation="vertical"><FieldLabel>Email</FieldLabel><Input name="email" type="email" placeholder="Enter your email" /></FieldWrapper>
tsx
<FieldWrapper orientation="horizontal"><FieldLabel>Phone:</FieldLabel><Input name="phone" placeholder="(11) 99999-9999" /></FieldWrapper>
tsx
<FieldWrapper orientation="horizontalReverse"><FieldLabel>I accept the terms of use</FieldLabel><Checkbox name="terms" /></FieldWrapper>
children - ReactNode (required)
Child elements that make up the field (label, input, error, etc.)orientation - "vertical" | "horizontal" | "horizontalReverse" (default: "vertical")
Defines the orientation of the elements inside the wrapper:className - string
Additional CSS classes for custom stylingsection, including onClick, onFocus, style, data-, aria-, etc.<section> element for appropriate grouping