
Security News
Microsoft Releases Open Source Toolkit for AI Agent Runtime Security
Microsoft has released an open source toolkit for enforcing runtime security policies on AI agents as adoption accelerates faster than governance controls.
@wpmudev/react-modal
Advanced tools
THIS IS A FORK.
SUI React Modal is based on a forked version of the react-aria-modal package and built according to WAI-ARIA Authoring Practices but ran out of maintenance.
The original package was hard to adapt for this project because of the number of dependencies dispersed across multiple Github repositories (some of which contained bugs that need immediate solutions).
However, being ours a modified version, it does things slightly different:
react-aria-modal dependencies into a single package.includeDefaultStyles and verticalCenterStyle built-in properties.The main idea of this module is to provide a container that will wrap its inner content to present it on a dialog modal. It has the following features while giving the developers complete control of the content:
TAB and SHIFT + TAB cycle through the modal's focusable nodes without returning to the main document beneath.ESC will close the modal.dialog or alertDialog are assigned depending on the case.Remember: This modal relies on the styling provided by WPMU DEV's Shared UI.
npm i @wpmudev/react-modal --save-dev
This requires React 16+
Just provide the right props (see below) and pass the modal's content as this component's child. However, if the modal needs to be more complex, like a "slider (steps)" or "replace" modal, you can review the demos showcase for a live example and more notes about it.
import React from 'react';
import { Modal } from '@wpmudev/react-modal';
const modalContent = () => <p>No, I am your father</p>;
const MyApp = () => (
<Modal
dialogId="uniqueId"
titleText="Accessible title"
modalContent={ modalContent }
/>
);
Properties like data-* or aria-* pass directly to the modal's container (sui-modal).
Type: string
Choose a unique ID for the dialog element.
Type: string
When the modal activates, its first focusable child will receive focus by default. If another specific element should receive initial focus, pass the string selector to this prop.
That selector is passed to document.querySelector() to find the DOM node.
Type: string
Use the ID of a text element as the modal's accessible title. The value passes to the modal's aria-labelledby attribute.
Important: You must use either titleId or titleText but not both.
Type: string
A string to use as the modal's accessible title. The value passes to the modal's aria-labelledby attribute.
Important: You must use either titleId or titleText but not both.
Type: string
A string to set modal size. You can choose between: sm | md | lg | xl
Type: object or function
Renders the content of the modal. To use Object is a requirement for slider modals, while simple modals use function as a must.
Type: function
Optional function to render the element that triggers the opening of the modal.
Type: string
For sliders modals only. This prop contains the key of the modalContent object that holds the first slide you want to show.
FAQs
WPMU DEV Shared UI React Modal Component
We found that @wpmudev/react-modal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Microsoft has released an open source toolkit for enforcing runtime security policies on AI agents as adoption accelerates faster than governance controls.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.