@schema-forms-data/core
v4.0.2
Published
Core types, enums and utilities for SchemaForms — zero runtime dependencies, pure TypeScript
Maintainers
Readme
@schema-forms-data/core
Core types, enums and utilities for SchemaForms. Zero runtime dependencies — pure TypeScript.
Install
npm install @schema-forms-data/coreMain exports
FormSchema
The top-level type for a complete form definition:
import type { FormSchema, FieldType } from "@schema-forms-data/core";
const schema: FormSchema = {
id: "my-form",
title: "My Form",
steps: [
{
id: "step-1",
title: "Personal info",
containers: [
{
id: "container-1",
columns: 2,
fields: [
{
id: "name",
fieldType: "texto",
label: "Full name",
required: true,
},
],
},
],
},
],
};FieldType enum values
| Value | Description |
| -------------------------- | --------------------------------- |
| texto | Single-line text input |
| textarea | Multi-line text area |
| email | Email input |
| select | Dropdown select |
| radio | Radio group |
| checkbox | Single checkbox |
| checkbox_group | Multiple checkboxes |
| date | Date picker |
| cpf / telefone / cep | Masked inputs |
| file | File upload |
| field_array | Repeatable group of fields |
| terms | PDF terms acceptance |
| participation_type | Business: participation modality |
| payment_method | Business: payment method selector |
| hidden | Hidden field |
generateId()
import { generateId } from "@schema-forms-data/core";
const id = generateId(); // "a1b2c3d4-..."License
MIT © SchemaFormsData
