Back to Vendure

FormField

docs/docs/reference/admin-ui-api/react-components/form-field.mdx

3.7.3964 B
Original Source
<GenerationInfo sourceFile="packages/admin-ui/src/lib/react/src/react-components/FormField.tsx" sourceLine="22" packageName="@vendure/admin-ui" />

A wrapper around form fields which provides a label, tooltip and error message.

Example

ts
import { FormField } from '@vendure/admin-ui/react';

export function MyReactComponent() {
    return (
       <FormField label="My field" tooltip="This is a tooltip" invalid errorMessage="This field is invalid">
           <input type="text" />
       </FormField>
    );
}
ts
function FormField(props: PropsWithChildren<{
        for?: string;
        label?: string;
        tooltip?: string;
        invalid?: boolean;
        errorMessage?: string;
    }>): void

Parameters

props

<MemberInfo kind="parameter" type={PropsWithChildren<{ for?: string; label?: string; tooltip?: string; invalid?: boolean; errorMessage?: string; }>} />