Framework-agnostic form primitives, Zod schemas, and validation utilities for government applications.
npm install @formkit-gov/core zodimport { createSSNSchema, createPhoneSchema, createFullNameSchema } from '@formkit-gov/core';
import { z } from 'zod';
const schema = z.object({
name: createFullNameSchema(),
ssn: createSSNSchema(),
phone: createPhoneSchema(),
});
const result = schema.safeParse(formData);For comprehensive documentation, examples, and API reference:
- Full Documentation - Complete API reference and examples
- Validation Guide - Schema options and patterns
- Form Patterns - Common form implementations
| Function | Description |
|---|---|
createTextSchema |
Text input validation |
createEmailSchema |
Email validation |
createPhoneSchema |
US/International phone |
createSSNSchema |
Social Security Number |
createDateSchema |
Date with min/max |
createAddressSchema |
US/Military/International |
createFullNameSchema |
First/middle/last/suffix |
createCurrencySchema |
USD currency |
| Function | Description |
|---|---|
validateSSN |
SSN format validation |
validatePhoneNumber |
Phone format validation |
formatPhoneNumber |
Format to (XXX) XXX-XXXX |
maskSSN |
Mask to ***-**-XXXX |
| Constant | Format |
|---|---|
SSN_PATTERN |
###-##-#### |
PHONE_PATTERN |
(###) ###-#### |
ZIP_CODE_PATTERN |
##### or #####-#### |
MIT