Module Skyline_dialog_v2Source

A Dialog is a layout view that is usually used within a Modal compponent.

Dialogs are created by composing multiple subviews together:

Layout behavior

The Dialog.view itself renders as a block element that sizes to its contents. It is typically used inside a Modal, which makes it an overlay element rendered in the browser top layer and constrained by the viewport.

Example

  {%html|
    <Skyline.Dialog.view>
      <Skyline.Dialog.Section.title>
        Dialog with separators
      </>
      <Skyline.Dialog.Close_button.content ~close:%{Effect.Ignore} />
      <Skyline.Dialog.Section.separator />
      <Skyline.Dialog.Section.text>
        This is the content of a dialog that can be used to display bigger blocks of
        content
      </>
      <Skyline.Dialog.Section.separator />
      <Skyline.Dialog.Section.footer>
        <Skyline.Button.view ~on_click:%{Effect.Ignore}>
          Confirm
        </>
        <Skyline.Button.view ~on_click:%{Effect.Ignore} ~intent:%{`Secondary}>
          Cancel
        </>
      </>
    </>
  |}
Sourcemodule Content : sig ... end

Opaque module reflecting content that is valid inside a view.

A dialog view's root.

Container for the dialog layout. You should only provide subviews from this module as children.

  • ?test_selector allows to select the element in tests.
  • ?size scales the size of Dialog.* view elements.
  • ?attrs allows to add arbitrary attrs to this element. We do not advise attaching style alterations to this element.

In Modals

By default a dialog will show up in the document's flow; it will not appear "over" the app in the way most dialogs are designed.

To get a "modal" dialog, use with the Modal.component in Skyline_modal_v2.

Sourcemodule Section : sig ... end
Sourcemodule Close_button : sig ... end
Sourcemodule For_docs : sig ... end