HOC SiteDokümantasyon

Modal

Decoration and visibility use Dekorasyon ve görünürlük (BlockShell).

Named overlay dialog with a single content slot. Nested FlexListBlock layout.direction/gap apply normally (panel is a flex column). ButtonBlock toggles it by stable block id (modalId); the Name field is an editor-only label and is not localized. Set ariaLabel for the public dialog accessible name (localized). Use Show in editor to edit the slot. On the published site the modal starts closed. placement is centered (default dialog), fullViewport, or edge (docked drawer via edge). Open and close animations are configured separately; optional panel glass uses translucent fill + backdrop blur. Focus is trapped while open and restored to the invoking control on dismiss.

Examples

Newsletter modal

{
  "name": "Newsletter",
  "ariaLabel": [
    {
      "if": "*",
      "is": "Newsletter signup"
    }
  ],
  "show": true,
  "content": [],
  "overlay": {
    "dismissOnBackdrop": [
      {
        "if": "*",
        "is": true
      }
    ]
  }
}

Fields

content

Nested blocks shown inside the modal panel.

content: []

ariaLabel

Public accessible name for the dialog (aria-label). Localized. Distinct from editor-only name.

ariaLabel: [{ if: "*", is: "Newsletter signup" }]

overlay

dismissOnBackdrop

When true, backdrop click and Escape close the modal. When false, only a button/wrapper targeting this modal (or other code) can close it.

overlay: {
  dismissOnBackdrop: [{ if: "*", is: true }]
}

overlayColor

Backdrop color. One authored color leaf: * is light, { theme: "dark" } is dark.

overlay: {
  overlayColor: [{ if: "*", is: "#00000066" }]
}

animation

openAnimationEnabled

When true, play an enter animation when the modal opens.

openAnimationEnabled: [{ if: "*", is: true }]

openAnimationType

Enter motion: fade, fadeScale, or slideUp.

animation: {
  openAnimationType: [{ if: "*", is: "fadeScale" }]
}

openAnimationDurationMs

Enter duration in milliseconds.

animation: {
  openAnimationDurationMs: [{ if: "*", is: 220 }]
}

closeAnimationEnabled

When true, play a leave animation when the modal closes.

closeAnimationEnabled: [{ if: "*", is: true }]

closeAnimationType

Leave motion: fade, fadeScale, or slideUp. Defaults to the open type when omitted.

animation: {
  closeAnimationType: [{ if: "*", is: "fadeScale" }]
}

closeAnimationDurationMs

Leave duration in milliseconds.

animation: {
  closeAnimationDurationMs: [{ if: "*", is: 180 }]
}

panel

panelBackgroundColor

Panel fill. One authored color leaf (* light, { theme: "dark" } dark). Use a translucent color for glass.

panel: {
  panelBackgroundColor: [{ if: "*", is: "#f0f0f54d" }]
}

panelBackdropEnabled

Enable backdrop-filter blur on the modal panel.

panelBackdropEnabled: [{ if: "*", is: true }]

panelBackdropBlurPx

Panel backdrop blur in pixels.

panel: {
  panelBackdropBlurPx: [{ if: "*", is: 15 }]
}

panelBackdropGrayscale

Panel backdrop grayscale amount from 0 to 1.

panel: {
  panelBackdropGrayscale: [{ if: "*", is: 1 }]
}

layout

placement

Dialog geometry: centered (default card), fullViewport (fills the viewport), or edge (side/top/bottom drawer).

layout: {
  placement: [{ if: "*", is: "centered" }]
}

edge

When placement is edge: which side to dock (top | right | bottom | left). Default right.

layout: {
  edge: [{ if: "*", is: "right" }]
}

Default props

{
  "name": "Modal",
  "ariaLabel": [
    {
      "if": "*",
      "is": ""
    }
  ],
  "shell": {
    "visibility": [
      {
        "if": "*",
        "is": true
      }
    ],
    "anchor": {
      "anchorId": [
        {
          "if": "*",
          "is": ""
        }
      ],
      "anchorKey": [
        {
          "if": "*",
          "is": ""
        }
      ]
    },
    "pointerEvents": [
      {
        "if": "*",
        "is": "auto"
      }
    ]
  },
  "overlay": {
    "dismissOnBackdrop": [
      {
        "if": "*",
        "is": true
      }
    ]
  },
  "animation": {
    "enabled": [
      {
        "if": "*",
        "is": true
      }
    ],
    "openAnimationType": [
      {
        "if": "*",
        "is": "fadeScale"
      }
    ],
    "openAnimationDurationMs": [
      {
        "if": "*",
        "is": 220
      }
    ],
    "closeAnimationType": [
      {
        "if": "*",
        "is": "fadeScale"
      }
    ],
    "closeAnimationDurationMs": [
      {
        "if": "*",
        "is": 180
      }
    ]
  },
  "panel": {
    "enabled": [
      {
        "if": "*",
        "is": false
      }
    ],
    "panelBackdropBlurPx": [
      {
        "if": "*",
        "is": 15
      }
    ],
    "panelBackdropGrayscale": [
      {
        "if": "*",
        "is": 0
      }
    ]
  }
}