{
  "id": "@typed/ui/Form#make",
  "canonicalId": "@typed/ui/Form#make",
  "symbol": {
    "id": "@typed/ui/Form#make",
    "packageName": "@typed/ui",
    "moduleName": "Form",
    "exportName": "make",
    "kind": "function",
    "signatures": [
      "export declare function make<const Fields extends FormFields>(codec: Schema.Struct<Fields>): SchemaBoundForm<Fields>;"
    ],
    "summary": "Binds a native form component family to one Struct codec.",
    "sections": {},
    "examples": [
      {
        "language": "ts",
        "code": "import { Schema } from \"effect\";\nimport { html } from \"@typed/template\";\nimport { RefSubject } from \"@typed/fx\";\nimport { component } from \"@typed/template\";\nimport * as Form from \"@typed/ui/Form\";\n\nconst Order = Form.make(Schema.Struct({\n  copies: Schema.FiniteFromString.pipe(Schema.check(Schema.isGreaterThan(0))),\n  includeNotes: Schema.Boolean,\n}));\n\nexport const PrintOrder = component(function* () {\n  const form = yield* Order.state({ copies: 1, includeNotes: false }, { id: \"print-order\" });\n  const submitting = RefSubject.map(form, (state) => state.submitting);\n  const preview = yield* RefSubject.make(\"No print request preview yet.\");\n  return html`<section>${Order.Root({\n    form,\n    content: [\n      Order.Label({ for: \"order-copies\", content: \"Copies\" }),\n      Order.NumberInput({ name: \"copies\", props: { id: \"order-copies\", min: 1, required: true } }),\n      Order.Error({ name: \"copies\" }),\n      Order.Checkbox({ name: \"includeNotes\", props: { id: \"order-notes\" } }),\n      Order.Label({ for: \"order-notes\", content: \"Include speaker notes\" }),\n      Order.Submit({ content: \"Preview print request\", props: { \"?disabled\": submitting } }),\n      Order.Reset({ content: \"Restore defaults\" }),\n    ],\n    onValidSubmit: (values) => RefSubject.set(\n      preview,\n      `${values.copies} copies; notes ${values.includeNotes ? \"included\" : \"excluded\"}.`,\n    ),\n  })}<p role=\"status\">${preview}</p></section>`;\n});"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/ui/src/Form.ts",
      "line": 2950
    },
    "since": "1.0.0",
    "category": "Schema-bound components"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/ui/Form#make",
    "packageName": "@typed/ui",
    "packageVersion": "1.0.0-beta.13",
    "moduleName": "Form",
    "consumerSpecifier": "@typed/ui/Form",
    "exportName": "make",
    "qualifiedName": "make",
    "declarationKey": "declaration:bf55a67628fc56f04d19693c",
    "family": "function",
    "signatures": [
      "export declare function make<const Fields extends FormFields>(codec: Schema.Struct<Fields>): SchemaBoundForm<Fields>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/ui/src/Form.ts",
        "start": {
          "line": 2950,
          "column": 1
        },
        "end": {
          "line": 3109,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/ui#Form.make",
      "@typed/ui/index#Form.make"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:bf55a67628fc56f04d19693c",
    "name": "make",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function make<const Fields extends FormFields>(codec: Schema.Struct<Fields>): SchemaBoundForm<Fields>;"
        ],
        "typeParameters": [
          "const Fields extends FormFields"
        ],
        "sourceSpans": [
          {
            "file": "packages/ui/src/Form.ts",
            "start": {
              "line": 2950,
              "column": 1
            },
            "end": {
              "line": 3109,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function make<const Fields extends FormFields>(codec: Schema.Struct<Fields>): SchemaBoundForm<Fields>;"
    ],
    "typeParameters": [
      "const Fields extends FormFields"
    ],
    "summary": "Binds a native form component family to one Struct codec.",
    "sections": {},
    "examples": [
      {
        "language": "ts",
        "code": "import { Schema } from \"effect\";\nimport { html } from \"@typed/template\";\nimport { RefSubject } from \"@typed/fx\";\nimport { component } from \"@typed/template\";\nimport * as Form from \"@typed/ui/Form\";\n\nconst Order = Form.make(Schema.Struct({\n  copies: Schema.FiniteFromString.pipe(Schema.check(Schema.isGreaterThan(0))),\n  includeNotes: Schema.Boolean,\n}));\n\nexport const PrintOrder = component(function* () {\n  const form = yield* Order.state({ copies: 1, includeNotes: false }, { id: \"print-order\" });\n  const submitting = RefSubject.map(form, (state) => state.submitting);\n  const preview = yield* RefSubject.make(\"No print request preview yet.\");\n  return html`<section>${Order.Root({\n    form,\n    content: [\n      Order.Label({ for: \"order-copies\", content: \"Copies\" }),\n      Order.NumberInput({ name: \"copies\", props: { id: \"order-copies\", min: 1, required: true } }),\n      Order.Error({ name: \"copies\" }),\n      Order.Checkbox({ name: \"includeNotes\", props: { id: \"order-notes\" } }),\n      Order.Label({ for: \"order-notes\", content: \"Include speaker notes\" }),\n      Order.Submit({ content: \"Preview print request\", props: { \"?disabled\": submitting } }),\n      Order.Reset({ content: \"Restore defaults\" }),\n    ],\n    onValidSubmit: (values) => RefSubject.set(\n      preview,\n      `${values.copies} copies; notes ${values.includeNotes ? \"included\" : \"excluded\"}.`,\n    ),\n  })}<p role=\"status\">${preview}</p></section>`;\n});"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/ui/src/Form.ts",
        "start": {
          "line": 2950,
          "column": 1
        },
        "end": {
          "line": 3109,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Schema-bound components"
  }
}
