stax-monorepo
    Preparing search index...

    Interface WhenConfig<E1, R1, E2, R2, N>

    Configuration for the when control flow (DOM-specific with animation support).

    interface WhenConfig<
        E1 = never,
        R1 = never,
        E2 = never,
        R2 = never,
        N extends DOMElement = DOMElement,
    > {
        animate?: AnimationOptions;
        container?: () => Element<N, never, never>;
        intro?: boolean;
        onFalse: () => Element<DOMElement, E2, R2>;
        onTrue: () => Element<DOMElement, E1, R1>;
    }

    Type Parameters

    • E1 = never
    • R1 = never
    • E2 = never
    • R2 = never
    • N extends DOMElement = DOMElement

      The container element type. Inferred from container if provided; defaults to HTMLElement | SVGElement otherwise.

    Index

    Optional animation configuration

    container?: () => Element<N, never, never>

    Optional custom container element. If not provided, defaults to a div with display: contents.

    intro?: boolean

    Re-animate the SSR/SSG-rendered branch on hydration. See EachConfig.intro for the full contract and FOUC caveat.

    onFalse: () => Element<DOMElement, E2, R2>

    Element to render when condition is false

    onTrue: () => Element<DOMElement, E1, R1>

    Element to render when condition is true