variable / @typed/ui/Composite

StateSchema

Effect Schema used by makeState to encode, decode, and hydrate Composite state.

Learn this UI primitive →

Package version
1.0.0-beta.13
Category
Active item state
Since
1.0.0

Import

import { StateSchema } from "@typed/ui/Composite";

Signatures

export declare const StateSchema: Schema.Struct<{
    readonly activeId: Schema.NullOr<Schema.String>;
    readonly orientation: Schema.Literals<readonly [
        "horizontal",
        "vertical",
        "both"
    ]>;
    readonly loop: Schema.Boolean;
    readonly rtl: Schema.Boolean;
    readonly virtualFocus: Schema.Boolean;
}>;

Why

A public schema makes hydration and serialized state use the same runtime validation as direct construction.

Ownership and lifetime

This declaration is data or schema metadata and acquires no resources.

Examples

import * as Schema from "effect/Schema";
import * as Composite from "@typed/ui/Composite";

const decodeState = Schema.decodeUnknownEffect(Composite.StateSchema);

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source