Skip to content

Field

Provides a flexible container for form inputs, labels, and helper text.

Please enter your first name
Please enter your last name
Select your occupation
Please type in your bio
import { Field } from '@fintech-sandpit/ui/react';
return (
<Field.Root
label="First name"
required
>
<Field.Input placeholder="John" />
<Field.ErrorText>
Invalid first name
</Field.ErrorText>
<Field.HelperText>
Please enter your first name
</Field.HelperText>
</Field.Root>
<Field.Root
label="Last name"
required
>
<Field.Input placeholder="Doe" />
<Field.ErrorText>
Invalid last name
</Field.ErrorText>
<Field.HelperText>
Please enter your last name
</Field.HelperText>
</Field.Root>
<Field.Root
label="Occupation"
required
>
<Field.Select>
<option disabled>
Select an occupation
</option>
<option value="software-engineer">
Software Engineer
</option>
<option value="product-manager">
Product Manager
</option>
<option value="designer">
Designer
</option>
</Field.Select>
<Field.ErrorText>
Invalid text
</Field.ErrorText>
<Field.HelperText>
Select your occupation
</Field.HelperText>
</Field.Root>
<Field.Root label="Bio">
<Field.Textarea
placeholder="Enter your bio here..."
rows={3}
autoresize
/>
<Field.ErrorText>
Invalid text
</Field.ErrorText>
<Field.HelperText>
Please type in your bio
</Field.HelperText>
</Field.Root>
);
NameTypeDefaultDescription
labelstringLabel of the field
orientationOrientationverticalOrientation of the field
sizeSizemdSize of the field
clearablebooleanfalseReserve the space for the clear trigger
requiredbooleanfalseWhether the field is required
invalidbooleanfalseWhether the field is invalid
readOnlybooleanfalseWhether the field is read only
disabledbooleanfalseWhether the field is disabled
type Orientation = 'horizontal' | 'vertical'
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'