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
Please enter your first name
Please enter your last name
Select your occupation
Please type in your bio
Example
Section titled “Example”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>);<script setup lang="ts">import { Field } from '@fintech-sandpit/ui/vue';</script>
<template> <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></template>Field Root Props
Section titled “Field Root Props”| Name | Type | Default | Description |
|---|---|---|---|
label | string | Label of the field | |
orientation | Orientation | vertical | Orientation of the field |
size | Size | md | Size of the field |
clearable | boolean | false | Reserve the space for the clear trigger |
required | boolean | false | Whether the field is required |
invalid | boolean | false | Whether the field is invalid |
readOnly | boolean | false | Whether the field is read only |
disabled | boolean | false | Whether the field is disabled |
| Name | Type | Default | Description |
|---|---|---|---|
label | string | Label of the field | |
orientation | Orientation | vertical | Orientation of the field |
size | Size | md | Size of the field |
clearable | boolean | false | Reserve the space for the clear trigger |
required | boolean | false | Whether the field is required |
invalid | boolean | false | Whether the field is invalid |
read-only | boolean | false | Whether the field is read only |
disabled | boolean | false | Whether the field is disabled |
type Orientation = 'horizontal' | 'vertical'type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'