PsyTask | API Docs
    Preparing search index...

    Variable ContainerConst

    Container: (
        props: { content: any; style?: string },
        ctx: Scene<any>,
    ) => HTMLDivElement = ...

    Centered container

    Type Declaration

      • (props: { content: any; style?: string }, ctx: Scene<any>): HTMLDivElement
      • Parameters

        • props: { content: any; style?: string }
        • ctx: Scene<any>

        Returns HTMLDivElement

    As setup

    using container = app.scene(Container, {
    defaultProps: { content: '' },
    });

    await container.show({ content: 'This is centered' });

    As component

    using adder = app.scene(
    adapter((props: { a: number; b: number }, ctx) =>
    Container({ content: () => props.a + props.b }, ctx),
    ),
    { defaultProps: { a: 0, b: 0 } },
    );

    await adder.show({ a: 1, b: 2 }); // shows 3