# Form.StateSchema

Builds the serializable schema for a form's hydrated state.

## Signatures

```ts
export declare function StateSchema<const Fields extends FormFields>(codec: Schema.Struct<Fields>): Schema.Struct<{
    readonly values: Schema.Struct<Fields>;
    readonly defaultValues: Schema.Struct<Fields>;
    readonly errors: Schema.Struct<OptionalFields<Fields, Schema.String>>;
    readonly meta: Schema.Struct<OptionalFields<Fields, Schema.Struct<{
        readonly dirty: Schema.Boolean;
        readonly touched: Schema.Boolean;
    }>>>;
    readonly submitting: Schema.Boolean;
}>;
```



## Examples

```ts
import { StateSchema } from "@typed/ui/Form"
import { Schema } from "effect"

const codec = Schema.Struct({ email: Schema.String })
const stateCodec = StateSchema(codec)
```
