Gathering detailed insights and metrics for @accessible/tabbable
Gathering detailed insights and metrics for @accessible/tabbable
Gathering detailed insights and metrics for @accessible/tabbable
Gathering detailed insights and metrics for @accessible/tabbable
tabbable
Returns an array of all tabbable DOM nodes within a containing node.
focus-trap
Trap focus within a DOM node.
@zag-js/tabbable
Small utility that returns an array of all* tabbable DOM nodes within a containing node.
@udecode/plate-tabbable
Tab into and out of void nodes and other elements
npm install @accessible/tabbable
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1 Stars
11 Commits
2 Watching
17 Branches
1 Contributors
Updated on 07 Jul 2020
TypeScript (82.46%)
JavaScript (17.54%)
Cumulative downloads
Total Downloads
Last day
-16.2%
279
Compared to previous day
Last week
0%
1,575
Compared to previous week
Last month
0.5%
8,016
Compared to previous month
Last year
-36.7%
110,624
Compared to previous year
npm i @accessible/tabbable
Returns an array of all* tabbable DOM nodes within a containing node. (* "all" has some necessary caveats, which you'll learn about by reading below.)
The following are considered tabbable:
<button>
<input>
<select>
<textarea>
<a>
with href
or xlink:href
attributes<audio>
and <videos>
with controls
attributes[contenteditable]
elementstabindex
Any of the above will not be considered tabbable, though, if any of the following are also true about it:
tabindex
disabled
display: none
or visibility: hidden
<input type="radio">
and a different radio in its group is checked
If you think a node should be included in your array of tabbables but it's not, all you need to do is add tabindex="0"
to deliberately include it. (Or if it is in your array but you don't want it, you can add tabindex="-1"
to deliberately exclude it.) This will also result in more consistent cross-browser behavior. For information about why your special node might not be included, see "More details", below.
tabbable(rootNode: HTMLElement, includeRootNode: boolean = false): HTMLElement[]
Returns an array of ordered tabbable node within the rootNode
.
Summary of ordering principles:
tabindex
attributes (1 or higher), ordered by ascending tabindex
and source order.tabindex
and any element that by default receives focus (listed above) and does not have a positive tabindex
set, in source order.<object>
and <iframe>
— so this means some elements that you can tab to in some browsers will be left out of the results. (To learn more about that stupid inconsistency, see this amazing table). To provide better consistency across browsers and ensure the elements you want in your tabbables list show up there, try adding tabindex="0"
to edge-case elements that Tabbable ignores.<iframe>
, <embed>
, <object>
, <summary>
, and <svg>
is inconsistent across browsers, so if you need an accurate read on one of these elements you should try giving it a tabindex
. (You'll also need to pay attention to the focusable
attribute on SVGs in IE & Edge.) But you also might not be able to get an accurate read — so you should avoid relying on it.checked
one in each group (and that is what you should usually do anyway). If there is no checked
radio in the radio group, all of the radios will be considered tabbable. (Some browsers do this, otherwise don't — there's not consistency.)<a>
elements by default: you have to change a setting to get the standard behavior. Tabbable does not know whether you've changed that setting or not, so it will include <a>
elements in its list.The creator is looking for a new maintainer and @accessibile
packages don't need some of the features
in the original, so I can make a smaller package with TypeScript types by forking :P
This library is forked from tabbable
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/11 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
45 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More