Hiyve Components - v1.0.0
    Preparing search index...

    Interface RegisterCustomField

    Describes a custom field rendered in the registration form.

    Values collected from custom fields are sent as metadata when calling the identity service's register() method.

    interface RegisterCustomField {
        defaultValue?: string;
        hidden?: boolean;
        label: string;
        name: string;
        options?: { label: string; value: string }[];
        placeholder?: string;
        readOnly?: boolean;
        required?: boolean;
        type?: "text" | "select";
        validate?: (
            value: string,
        ) => string | Promise<string | null | undefined> | null | undefined;
    }
    Index

    Properties

    defaultValue?: string

    Default value

    hidden?: boolean

    Whether the field is hidden (default: false). Hidden fields are not rendered but their defaultValue is included in metadata.

    label: string

    Display label

    name: string

    Key in the metadata object

    options?: { label: string; value: string }[]

    Options for select fields

    placeholder?: string

    Placeholder text

    readOnly?: boolean

    Whether the field is read-only (default: false)

    required?: boolean

    Whether the field is required (default: false)

    type?: "text" | "select"

    Field type (default: 'text')

    validate?: (
        value: string,
    ) => string | Promise<string | null | undefined> | null | undefined

    Optional validator run at submit time, after the built-in required check. Return an error message to block submission and display it on the field; return null/undefined to accept the value. May be async — e.g. a server lookup verifying a referral or invite code exists — in which case the form stays in its submitting state until the validator resolves. A thrown error blocks submission with the thrown message.