Modal component uses the native dialog element to provide a modal dialog which comes with browser-specific
behavior. As a result, accessibility features may vary across different browsers.Tab, Shift-TabESCfocus on trigger elementaria property:aria-labelroledialog or alertdialog).aria-label="STRING"aria property is provided, uses the contents of the header slot and falls back to a fixed name.dialog, the aria-haspopup attribute must be set using the aria
property.aria-haspopup through the trigger component aria prop when opening the modal.header slot or aria property.<p-button aria-haspopup="dialog">
Details of product XYZ
</p-button><p-button aria="{'aria-haspopup': 'dialog'}">
Details of product XYZ
</p-button><p-modal aria-label="Details">
...
</p-modal><p-modal>
<p-heading slot="header" tag="h2" size="lg">
Details of product XYZ
</p-heading>
...
</p-modal>
<!-- or with aria prop when no visible header is shown -->
<p-modal aria="{'aria-label': 'Details of product XYZ'}">
...
</p-modal><p-button>
Open
</p-button>
<p-modal>
<p-heading slot="header" tag="h2" size="lg">
Details
</p-heading>
...
</p-modal><p-button aria="{'aria-haspopup': 'dialog'}">
Details of product XYZ
</p-button>
<p-modal>
<p-heading slot="header" tag="h2" size="lg">
Details of product XYZ
</p-heading>
...
</p-modal>