react-focus-marshal

1.0.1 • Public • Published

Focus Marshal

Traps focus within a DOM node — subsequently mounted traps will pause others and take focus responsibility until they unmount.

import { FocusTrap, FocusMarshal } from 'react-focus-marshal';
 
const Modal = () => (
  <FocusTrap>
    <div>
      {/* modal content */}
    </div>
  </FocusTrap>
);
 
const App = () => (
  <FocusMarshal>
    <Modal />
  </FocusMarshal>
);

Readme

Keywords

Package Sidebar

Install

npm i react-focus-marshal

Weekly Downloads

36

Version

1.0.1

License

MIT

Unpacked Size

252 kB

Total Files

9

Last publish

Collaborators

  • jossmac