UNPKG

react-tabindex

Version:

Sanely manage <kbd>Tab</kbd> accessibility in React with `<Untabbable>` and the `useTabIndex` hook!

2 lines (1 loc) 288 B
import e,{useContext as r}from"react";var t=e.createContext(!1);function n({active:n=!0,children:o,reset:c=!1}){const a=r(t),i=Boolean(c?n:n||a);return e.createElement(t.Provider,{value:i},o)}function o(e){return r(t)?-1:e}export{n as Untabbable,t as UntabbableContext,o as useTabIndex};