form-graph
    Preparing search index...

    Function textOf

    • A text field. The INPUT stays lenient regardless of the output — that's the dual-schema contract that lets a field HOLD a half-typed invalid value (rejected only at submit) instead of snapping to the default while typing. output overrides the strict contract (formats, messages) without giving that up:

      textOf({ output: z.string().email('A valid email is required') })

      Parameters

      • Optionalcfg: { default?: string; maxLength?: number; required?: boolean }

      Returns FieldDef<string, undefined, RefinableSchema<string>>

    • A text field. The INPUT stays lenient regardless of the output — that's the dual-schema contract that lets a field HOLD a half-typed invalid value (rejected only at submit) instead of snapping to the default while typing. output overrides the strict contract (formats, messages) without giving that up:

      textOf({ output: z.string().email('A valid email is required') })

      Type Parameters

      Parameters

      • cfg: { default?: string; maxLength?: number; output: O; required?: boolean }

      Returns FieldDef<string, undefined, O>