LayerDialog

A second layer slides over the first (add model → review values); Back returns.

View source
import { LayerDialog } from "@logicplanes/kaeso-ui";

Props

  • anchor
    "top" | "center" = top

    Where it sits: with a fixed top edge (default), so the title stays put on layers of different heights, or centered.

  • busy
    boolean

    Keeps the dialog open while work it started is underway: Escape, a press outside, the close circle, Dialog.Close, Enter and ⌘Enter do nothing, so a request is never abandoned or sent twice.

  • defaultOpen
    boolean

    Whether it starts open, when the component keeps its own state.

  • hideClose
    boolean

    Hide the close circle (rare).

  • inline
    boolean

    Render without a portal and backdrop, for documentation and state matrices.

  • layer
    number

    The visible layer; layers above the first slide over it.

  • layers
    DialogLayer[]

    The layers, each with its title, content and footer, and optionally a toolbar and a footer start; one shows at a time, and the ones below it stay mounted and hidden.

  • onLayerChange
    ((layer: number) => void)

    Called with the index of the layer shown.

  • onOpenChange
    ((open: boolean) => void)

    Called when it opens or closes.

  • onSubmit
    (() => void)

    Enter in a single-line field and ⌘/Ctrl+Enter call this on every layer; pass the action of the layer shown.

  • open
    boolean

    Whether it is open, when you control it.

  • persistent
    boolean

    A press outside doesn't close it, for forms that would lose what was typed; Escape and the close circle still do. Every StepDialog is persistent.

  • size
    "md" | "sm" | "lg"

    The dialog's width.

  • trigger
    ReactElement<unknown, string | JSXElementConstructor<any>>

    The trigger, a single element.