Dialog

A modal dialog: 440, 560 or 720 wide, radius 20; title, description, body, actions. ⌘Enter submits. Longer forms use StepDialog: one question per step.

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

Props

  • children
    ReactNode

    The dialog's content and actions.

  • defaultOpen
    boolean

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

  • description
    ReactNode

    One sentence under the title.

  • footer
    ReactNode

    Right-aligned actions: Cancel (secondary) then the primary.

  • headerStart
    ReactNode

    A top bar above the title, with this at its start and the close circle at its end (LayerDialog's back button). The title, description and content keep one left edge; null keeps the bar with an empty start.

  • hideClose
    boolean

    Hide the close circle (rare).

  • inline
    boolean

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

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

    Called when it opens or closes.

  • onSubmit
    (() => void)

    ⌘Enter calls this (usually the primary action).

  • open
    boolean

    Whether it is open, when you control it.

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

    The dialog's width.

  • title
    ReactNode

    The dialog's heading, also its accessible name.

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

    The trigger, a single element.