<tab-container> Custom Element — An Accessible Tab Container Element with Keyboard Support

Built by GitHub is <tab-container>, a Custom Element that defines an accessible tab container element with keyboard support and that also follows the ARIA best practices guide on tabs. Upon importing the package it will register the Custom Element, so you can use it immediately: <tab-container> <div role=”tablist”> <button type=”button” role=”tab” aria-selected=”true”>Tab one</button> <button type=”button” …


This content originally appeared on Bram.us and was authored by Bramus!

Built by GitHub is <tab-container>, a Custom Element that defines an accessible tab container element with keyboard support and that also follows the ARIA best practices guide on tabs.

Upon importing the package it will register the Custom Element, so you can use it immediately:

<tab-container>
  <div role="tablist">
    <button type="button" role="tab" aria-selected="true">Tab one</button>
    <button type="button" role="tab" tabindex="-1">Tab two</button>
    <button type="button" role="tab" tabindex="-1">Tab three</button>
  </div>
  <div role="tabpanel">
    Panel 1
  </div>
  <div role="tabpanel" hidden>
    Panel 2
  </div>
  <div role="tabpanel" hidden>
    Panel 3
  </div>
</tab-container>

Installation possible per NPM:

npm install @github/tab-container-element

… or import it directly off of Skypack

import "https://cdn.skypack.dev/@github/tab-container-element";

<tab-container> Source →
<tab-container> Demo →


This content originally appeared on Bram.us and was authored by Bramus!


Print Share Comment Cite Upload Translate Updates
APA

Bramus! | Sciencx (2021-03-14T22:54:13+00:00) <tab-container> Custom Element — An Accessible Tab Container Element with Keyboard Support. Retrieved from https://www.scien.cx/2021/03/14/tab-container-custom-element-an-accessible-tab-container-element-with-keyboard-support/

MLA
" » <tab-container> Custom Element — An Accessible Tab Container Element with Keyboard Support." Bramus! | Sciencx - Sunday March 14, 2021, https://www.scien.cx/2021/03/14/tab-container-custom-element-an-accessible-tab-container-element-with-keyboard-support/
HARVARD
Bramus! | Sciencx Sunday March 14, 2021 » <tab-container> Custom Element — An Accessible Tab Container Element with Keyboard Support., viewed ,<https://www.scien.cx/2021/03/14/tab-container-custom-element-an-accessible-tab-container-element-with-keyboard-support/>
VANCOUVER
Bramus! | Sciencx - » <tab-container> Custom Element — An Accessible Tab Container Element with Keyboard Support. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/03/14/tab-container-custom-element-an-accessible-tab-container-element-with-keyboard-support/
CHICAGO
" » <tab-container> Custom Element — An Accessible Tab Container Element with Keyboard Support." Bramus! | Sciencx - Accessed . https://www.scien.cx/2021/03/14/tab-container-custom-element-an-accessible-tab-container-element-with-keyboard-support/
IEEE
" » <tab-container> Custom Element — An Accessible Tab Container Element with Keyboard Support." Bramus! | Sciencx [Online]. Available: https://www.scien.cx/2021/03/14/tab-container-custom-element-an-accessible-tab-container-element-with-keyboard-support/. [Accessed: ]
rf:citation
» <tab-container> Custom Element — An Accessible Tab Container Element with Keyboard Support | Bramus! | Sciencx | https://www.scien.cx/2021/03/14/tab-container-custom-element-an-accessible-tab-container-element-with-keyboard-support/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.