use-tabbable-list
v1.0.3
Published
React hook that returns all tabbable elements within a DOM node
Downloads
8
Maintainers
Readme
use-tabbable-list
React hook that returns all tabbable elements within a DOM node
Installation
$ npm install use-tabbable-list
Usage
import useTabbableList from 'use-tabbable-list'
function Example() {
const ref = useRef(null)
const tabbableList = useTabbableList(ref)
return (
<div ref={ref}>
<input />
<button>Click!</button>
</div>
)
}
API
useTabbableList(ref)
ref
A reference to a DOM Node.
Return value
An array of all tabbable elements within the ref
node.
License
MIT