API Reference
AdditionalFields
The AdditionalFields
interface allows you to define custom fields for your authentication flow such as signup or user settings.
Usage
You can configure additionalFields
like this:
<AuthUIProvider
authClient={authClient}
additionalFields={{
age: {
label: "Age",
placeholder: "Your age",
description: "Enter your age",
required: true,
type: "number"
},
newsletter: {
label: "Newsletter Opt-In",
description: "Subscribe to the newsletter",
required: false,
type: "boolean",
}
}}
>
{children}
</AuthUIProvider>
AdditionalField
Prop | Type | Default |
---|---|---|
validate? | ((value: string) => Promise<boolean>) | - |
type | FieldType | - |
required? | boolean | - |
placeholder? | string | - |
label | ReactNode | - |
instructions? | any | - |
description? | any | - |