सुलभता पैटर्न · डेटा प्रदर्शन

ट्री व्यू

ट्री Tab क्रम में एक ही पड़ाव है। ऊपर और नीचे दिखने वाले आइटम पर चलते हैं, दायाँ किसी फ़ोल्डर को खोलता है या उसके अंदर ले जाता है, और बायाँ उसे बंद करता है या उसके पैरेंट पर ले जाता है। नेस्टेड समूह हर आइटम को उसका स्तर और उसके सेट में उसकी जगह देते हैं, इसलिए स्क्रीन रीडर बिना अतिरिक्त एट्रिब्यूट के "स्तर 3, 3 में से 1" कह सकता है।

डब्ल्यूसीएजी मानदंड
6
कीबोर्ड नियम
7
जाँच का तरीक़ा
axe, कीबोर्ड और इंस्पेक्टर

लाइव डेमो

आज़माएँ

इसे माउस, कीबोर्ड या स्क्रीन रीडर से इस्तेमाल करें। साथ का इंस्पेक्टर दिखाता है कि आपके इस्तेमाल के दौरान ब्राउज़र सहायक तकनीक को क्या बताता है: फ़ोकस, स्थिति में बदलाव और घोषणाएँ।

प्रोजेक्ट की फ़ाइलें

storefront

  • src
    • components
      • Button.tsx
      • Card.tsx
      • Dialog.tsx
    • main.ts
  • package.json
  • README.md
  • vite.config.ts

विवरण

Button.tsx

React कंपोनेंट

आकार
2.4 KB
बदला गया
4 अक्टूबर 2026
स्थान
storefront / src / components

जावास्क्रिप्ट के बिना डेमो उतना ही काम करता है जितना उसका एचटीएमएल; इंस्पेक्टर के लिए जावास्क्रिप्ट चाहिए।

कीबोर्ड

जिन कुंजियों पर यह काम करता है

हर क्रिया पॉइंटर के बिना काम करती है।

कुंजीयह क्या करती है
Arrow DownयाArrow Upअगले या पिछले दिखने वाले आइटम पर ले जाता है, कुछ खोले या बंद किए बिना।
Arrow Rightबंद फ़ोल्डर को खोलता है; खुले फ़ोल्डर पर, उसके पहले आइटम पर ले जाता है।
Arrow Leftखुले फ़ोल्डर को बंद करता है; किसी और चीज़ पर, उसे रखने वाले फ़ोल्डर पर ले जाता है।
HomeयाEndपहले या आख़िरी दिखने वाले आइटम पर ले जाता है।
EnterयाSpaceफ़ोकस वाला आइटम चुनता है और उसे विवरण पैनल में दिखाता है।
*फ़ोकस वाले आइटम के स्तर के सभी फ़ोल्डर खोलता है।
A–Zअगले उस आइटम पर ले जाता है जिसका नाम टाइप किए गए अक्षरों से शुरू होता है।

स्क्रीन रीडर

यह क्या घोषित करता है

मार्कअप की भूमिकाओं, नामों और स्थितियों से लिखा गया।

कबअपेक्षित घोषणा
Tab ट्री पर पहुँचता हैप्रोजेक्ट की फ़ाइलें, ट्री। Button.tsx, चयनित, स्तर 3, 3 में से 1
Arrow Down अगली फ़ाइल पर ले जाता हैCard.tsx, चयनित नहीं, स्तर 3, 3 में से 2
फ़ोकस किसी बंद फ़ोल्डर पर पहुँचता है“pages”, बंद, स्तर 2, 4 में से 2
Arrow Right उसे खोलता हैखुला
Enter फ़ोकस वाली फ़ाइल चुनता हैCard.tsx, चयनित

ये अपेक्षित घोषणाएँ हैं, रिकॉर्डिंग नहीं। स्क्रीन रीडर और ब्राउज़र के हिसाब से शब्द और क्रम बदलते हैं।

कोड

कोड कॉपी करें

वही फ़ाइलें जिन पर यह डेमो चलता है। स्टाइल एक प्रीफ़िक्स के साथ परोसी जाती हैं जो इस साइट की अपनी स्टाइल को डेमो से दूर रखता है; आप जो कॉपी करते हैं वह मूल है।

मार्कअप

<div class="ap-tree" data-ap-tree>
  <div class="ap-tree__top">
    <h3 class="ap-tree__name" id="tree-name">Project files</h3>
    <p class="ap-tree__sub" translate="no">storefront</p>
  </div>
  <div class="ap-tree__body">
    <ul class="ap-tree__list" role="tree" aria-labelledby="tree-name" data-root="storefront">
      <li class="ap-tree__item" role="treeitem" aria-expanded="true" aria-labelledby="tree-src" tabindex="-1" data-kind="Folder" data-size="4 items" data-modified="4 Oct 2026">
        <span class="ap-tree__row"><svg class="ap-tree__chev" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m9.5 6.5 5.5 5.5-5.5 5.5"/></svg><svg class="ap-tree__icon ap-tree__icon--shut" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3.5 7.5a2 2 0 0 1 2-2h3.6l2 2.2h7.4a2 2 0 0 1 2 2v7.8a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2Z"/></svg><svg class="ap-tree__icon ap-tree__icon--open" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3.5 17V7.5a2 2 0 0 1 2-2h3.6l2 2.2h6.4a2 2 0 0 1 2 2v1"/><path d="M3.6 18.2 6.2 11.6a1.6 1.6 0 0 1 1.5-1h12.8l-2.7 7.3a1.6 1.6 0 0 1-1.5 1H5a1.4 1.4 0 0 1-1.4-.7Z"/></svg><span class="ap-tree__label" id="tree-src" translate="no">src</span></span>
        <ul class="ap-tree__group" role="group">
          <li class="ap-tree__item" role="treeitem" aria-expanded="true" aria-labelledby="tree-src-components" tabindex="-1" data-kind="Folder" data-size="3 items" data-modified="4 Oct 2026">
            <span class="ap-tree__row"><svg class="ap-tree__chev" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m9.5 6.5 5.5 5.5-5.5 5.5"/></svg><svg class="ap-tree__icon ap-tree__icon--shut" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3.5 7.5a2 2 0 0 1 2-2h3.6l2 2.2h7.4a2 2 0 0 1 2 2v7.8a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2Z"/></svg><svg class="ap-tree__icon ap-tree__icon--open" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3.5 17V7.5a2 2 0 0 1 2-2h3.6l2 2.2h6.4a2 2 0 0 1 2 2v1"/><path d="M3.6 18.2 6.2 11.6a1.6 1.6 0 0 1 1.5-1h12.8l-2.7 7.3a1.6 1.6 0 0 1-1.5 1H5a1.4 1.4 0 0 1-1.4-.7Z"/></svg><span class="ap-tree__label" id="tree-src-components" translate="no">components</span></span>
            <ul class="ap-tree__group" role="group">
              <li class="ap-tree__item" role="treeitem" tabindex="0" aria-selected="true" data-kind="React component" data-size="2.4 KB" data-modified="4 Oct 2026">
                <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">Button.tsx</span></span>
              </li>
              <li class="ap-tree__item" role="treeitem" tabindex="-1" data-kind="React component" data-size="1.8 KB" data-modified="28 Sep 2026">
                <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">Card.tsx</span></span>
              </li>
              <li class="ap-tree__item" role="treeitem" tabindex="-1" data-kind="React component" data-size="3.9 KB" data-modified="1 Oct 2026">
                <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">Dialog.tsx</span></span>
              </li>
            </ul>
          </li>
          <li class="ap-tree__item" role="treeitem" aria-expanded="false" aria-labelledby="tree-src-pages" tabindex="-1" data-kind="Folder" data-size="3 items" data-modified="2 Oct 2026">
            <span class="ap-tree__row"><svg class="ap-tree__chev" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m9.5 6.5 5.5 5.5-5.5 5.5"/></svg><svg class="ap-tree__icon ap-tree__icon--shut" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3.5 7.5a2 2 0 0 1 2-2h3.6l2 2.2h7.4a2 2 0 0 1 2 2v7.8a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2Z"/></svg><svg class="ap-tree__icon ap-tree__icon--open" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3.5 17V7.5a2 2 0 0 1 2-2h3.6l2 2.2h6.4a2 2 0 0 1 2 2v1"/><path d="M3.6 18.2 6.2 11.6a1.6 1.6 0 0 1 1.5-1h12.8l-2.7 7.3a1.6 1.6 0 0 1-1.5 1H5a1.4 1.4 0 0 1-1.4-.7Z"/></svg><span class="ap-tree__label" id="tree-src-pages" translate="no">pages</span></span>
            <ul class="ap-tree__group" role="group" hidden>
              <li class="ap-tree__item" role="treeitem" tabindex="-1" data-kind="React component" data-size="5.2 KB" data-modified="2 Oct 2026">
                <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">Checkout.tsx</span></span>
              </li>
              <li class="ap-tree__item" role="treeitem" tabindex="-1" data-kind="React component" data-size="3.1 KB" data-modified="19 Sep 2026">
                <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">Home.tsx</span></span>
              </li>
              <li class="ap-tree__item" role="treeitem" tabindex="-1" data-kind="React component" data-size="4.6 KB" data-modified="30 Sep 2026">
                <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">Orders.tsx</span></span>
              </li>
            </ul>
          </li>
          <li class="ap-tree__item" role="treeitem" aria-expanded="false" aria-labelledby="tree-src-styles" tabindex="-1" data-kind="Folder" data-size="2 items" data-modified="27 Sep 2026">
            <span class="ap-tree__row"><svg class="ap-tree__chev" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m9.5 6.5 5.5 5.5-5.5 5.5"/></svg><svg class="ap-tree__icon ap-tree__icon--shut" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3.5 7.5a2 2 0 0 1 2-2h3.6l2 2.2h7.4a2 2 0 0 1 2 2v7.8a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2Z"/></svg><svg class="ap-tree__icon ap-tree__icon--open" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3.5 17V7.5a2 2 0 0 1 2-2h3.6l2 2.2h6.4a2 2 0 0 1 2 2v1"/><path d="M3.6 18.2 6.2 11.6a1.6 1.6 0 0 1 1.5-1h12.8l-2.7 7.3a1.6 1.6 0 0 1-1.5 1H5a1.4 1.4 0 0 1-1.4-.7Z"/></svg><span class="ap-tree__label" id="tree-src-styles" translate="no">styles</span></span>
            <ul class="ap-tree__group" role="group" hidden>
              <li class="ap-tree__item" role="treeitem" tabindex="-1" data-kind="Stylesheet" data-size="1.2 KB" data-modified="27 Sep 2026">
                <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">global.css</span></span>
              </li>
              <li class="ap-tree__item" role="treeitem" tabindex="-1" data-kind="Stylesheet" data-size="2.7 KB" data-modified="25 Sep 2026">
                <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">tokens.css</span></span>
              </li>
            </ul>
          </li>
          <li class="ap-tree__item" role="treeitem" tabindex="-1" data-kind="TypeScript file" data-size="0.6 KB" data-modified="12 Sep 2026">
            <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">main.ts</span></span>
          </li>
        </ul>
      </li>
      <li class="ap-tree__item" role="treeitem" aria-expanded="false" aria-labelledby="tree-public" tabindex="-1" data-kind="Folder" data-size="2 items" data-modified="8 Sep 2026">
        <span class="ap-tree__row"><svg class="ap-tree__chev" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m9.5 6.5 5.5 5.5-5.5 5.5"/></svg><svg class="ap-tree__icon ap-tree__icon--shut" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3.5 7.5a2 2 0 0 1 2-2h3.6l2 2.2h7.4a2 2 0 0 1 2 2v7.8a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2Z"/></svg><svg class="ap-tree__icon ap-tree__icon--open" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3.5 17V7.5a2 2 0 0 1 2-2h3.6l2 2.2h6.4a2 2 0 0 1 2 2v1"/><path d="M3.6 18.2 6.2 11.6a1.6 1.6 0 0 1 1.5-1h12.8l-2.7 7.3a1.6 1.6 0 0 1-1.5 1H5a1.4 1.4 0 0 1-1.4-.7Z"/></svg><span class="ap-tree__label" id="tree-public" translate="no">public</span></span>
        <ul class="ap-tree__group" role="group" hidden>
          <li class="ap-tree__item" role="treeitem" tabindex="-1" data-kind="SVG image" data-size="1.1 KB" data-modified="8 Sep 2026">
            <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">favicon.svg</span></span>
          </li>
          <li class="ap-tree__item" role="treeitem" tabindex="-1" data-kind="Text file" data-size="68 bytes" data-modified="8 Sep 2026">
            <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">robots.txt</span></span>
          </li>
        </ul>
      </li>
      <li class="ap-tree__item" role="treeitem" aria-expanded="false" aria-labelledby="tree-tests" tabindex="-1" data-kind="Folder" data-size="2 items" data-modified="3 Oct 2026">
        <span class="ap-tree__row"><svg class="ap-tree__chev" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m9.5 6.5 5.5 5.5-5.5 5.5"/></svg><svg class="ap-tree__icon ap-tree__icon--shut" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3.5 7.5a2 2 0 0 1 2-2h3.6l2 2.2h7.4a2 2 0 0 1 2 2v7.8a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2Z"/></svg><svg class="ap-tree__icon ap-tree__icon--open" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3.5 17V7.5a2 2 0 0 1 2-2h3.6l2 2.2h6.4a2 2 0 0 1 2 2v1"/><path d="M3.6 18.2 6.2 11.6a1.6 1.6 0 0 1 1.5-1h12.8l-2.7 7.3a1.6 1.6 0 0 1-1.5 1H5a1.4 1.4 0 0 1-1.4-.7Z"/></svg><span class="ap-tree__label" id="tree-tests" translate="no">tests</span></span>
        <ul class="ap-tree__group" role="group" hidden>
          <li class="ap-tree__item" role="treeitem" tabindex="-1" data-kind="TypeScript file" data-size="1.9 KB" data-modified="3 Oct 2026">
            <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">button.test.ts</span></span>
          </li>
          <li class="ap-tree__item" role="treeitem" tabindex="-1" data-kind="TypeScript file" data-size="3.4 KB" data-modified="2 Oct 2026">
            <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">checkout.test.ts</span></span>
          </li>
        </ul>
      </li>
      <li class="ap-tree__item" role="treeitem" tabindex="-1" data-kind="JSON file" data-size="1.3 KB" data-modified="29 Sep 2026">
        <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">package.json</span></span>
      </li>
      <li class="ap-tree__item" role="treeitem" tabindex="-1" data-kind="Markdown file" data-size="2.2 KB" data-modified="15 Sep 2026">
        <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">README.md</span></span>
      </li>
      <li class="ap-tree__item" role="treeitem" tabindex="-1" data-kind="TypeScript file" data-size="0.4 KB" data-modified="10 Sep 2026">
        <span class="ap-tree__row"><span class="ap-tree__spacer"></span><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><span class="ap-tree__label" translate="no">vite.config.ts</span></span>
      </li>
    </ul>

    <section class="ap-tree__details" aria-labelledby="tree-details-name" data-ap-details>
      <h3 class="ap-tree__pane-name" id="tree-details-name">Details</h3>
      <div class="ap-tree__preview">
        <span class="ap-tree__tile" aria-hidden="true"><svg class="ap-tree__icon ap-tree__icon--file" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6.5 3.5h7l4.5 4.5v12.5h-11.5Z"/><path d="M13.5 3.5V8H18"/></svg><svg class="ap-tree__icon ap-tree__icon--shut" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3.5 7.5a2 2 0 0 1 2-2h3.6l2 2.2h7.4a2 2 0 0 1 2 2v7.8a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2Z"/></svg></span>
        <div>
          <p class="ap-tree__file" translate="no" data-ap-file>Button.tsx</p>
          <p class="ap-tree__kind" data-ap-kind>React component</p>
        </div>
      </div>
      <dl class="ap-tree__facts">
        <div><dt>Size</dt><dd data-ap-size>2.4 KB</dd></div>
        <div><dt>Modified</dt><dd data-ap-modified>4 Oct 2026</dd></div>
        <div><dt>Location</dt><dd translate="no" data-ap-where>storefront / src / components</dd></div>
      </dl>
    </section>
  </div>
</div>

डब्ल्यूसीएजी 2.2

यह किन मानदंडों को पूरा करता है

वे सफलता मानदंड जिनका यह पैटर्न ध्यान रखता है, और कैसे।

  • 1.3.1 जानकारी और संबंध स्तर A

    नेस्टेड role=group सूचियाँ हर आइटम को उसका स्तर, उसकी जगह और उसके सेट का आकार देती हैं; फ़ोल्डर aria-expanded बताते हैं।

  • 1.4.1 रंग का उपयोग स्तर A

    चयन सिर्फ़ हल्के रंग से नहीं, बल्कि मोटे अक्षरों, पंक्ति की शुरुआत में एक पट्टी और विवरण पैनल से दिखाया जाता है।

  • 2.1.1 कीबोर्ड स्तर A

    हर काम के लिए एक कुंजी है: चलने, खोलने और बंद करने के लिए ऐरो, चुनने के लिए Enter या Space, एक स्तर खोलने के लिए *, और सीधे पहुँचने के लिए अक्षर।

  • 2.4.3 फ़ोकस क्रम स्तर A

    ट्री एक टैब स्टॉप है जो आख़िरी इस्तेमाल किए गए आइटम पर लौटता है; पढ़ने के क्रम में विवरण पैनल उसके बाद आता है।

  • 2.4.7 फ़ोकस दिखाई देना स्तर AA

    फ़ोकस वाली पंक्ति पर दो पिक्सेल की रिंग दिखती है, जो चुनी गई पंक्ति के रंग से अलग है, ताकि दोनों एक साथ दिख सकें।

  • 4.1.2 नाम, भूमिका, मान स्तर A

    आइटम पर role=treeitem है और नाम उनके लेबल से आता है, फ़ोल्डर पर aria-expanded है, और चुने गए आइटम पर aria-selected है।

उपयोग

इसे कब इस्तेमाल करें

इसे अपनाएँ

  • ऐसे पदानुक्रम जिन्हें लोग चलते-चलते खोलते और बंद करते हैं, जैसे फ़ोल्डर, साइट मैप या नेस्टेड श्रेणियाँ।
  • गहरे ढाँचे से कोई एक आइटम चुनना, यह देखते हुए कि वह कहाँ है।

कुछ और इस्तेमाल करें

  • साइट नेविगेशन: लिंक की नेस्टेड सूचियों वाला nav लैंडमार्क सरल है और बाक़ी वेब की तरह काम करता है।
  • दो या उससे कम स्तर: अकॉर्डियन या समूहों वाली सूची कम सीखने में वही बात कह देती है।
  • पदानुक्रम में तालिका जैसा डेटा, हर पंक्ति में कॉलम के साथ: वह treegrid है।

आम विफलताएँ

आमतौर पर यह कहाँ गलत होता है

  • Tab क्रम में हर आइटम

    चालीस दिखने वाले आइटम वाले ट्री से निकलने में चालीस बार Tab नहीं लगना चाहिए। एक टैब स्टॉप, अंदर ऐरो कुंजियाँ, यही तरीका स्क्रीन रीडर इस्तेमाल करने वाले जानते हैं।

  • हर आइटम पर aria-selected="false"

    एक ही चयन वाले ट्री में, बाक़ी सबको चयनित नहीं चिह्नित करने से स्क्रीन रीडर हर पंक्ति पर यही दोहराते हैं। सिर्फ़ चुने गए आइटम पर aria-selected होता है।

  • अपने अंदर की हर चीज़ से नाम पाने वाले फ़ोल्डर

    पैरेंट आइटम के टेक्स्ट में उसके चाइल्ड भी आते हैं, इसलिए सामग्री से बना उसका नाम दर्जनों फ़ाइलों तक लंबा हो सकता है। aria-labelledby हर फ़ोल्डर को उसके अपने लेबल से जोड़ता है।

  • पहुँच में छूटे बंद आइटम

    सिर्फ़ आँखों से छिपे चाइल्ड आइटम फिर भी पढ़े जाते हैं और ऐरो कुंजियों से मिल जाते हैं। समूह पर hidden एट्रिब्यूट उन्हें सबके लिए हटा देता है।

  • एक जैसे दिखने वाले फ़ोकस और चयन

    अगर फ़ोकस रिंग और चुनी गई पंक्ति का स्टाइल एक हो, तो लोग समझ नहीं पाते कि वे कहाँ हैं और उन्होंने क्या चुना। यहाँ रिंग और रंगीन पट्टी अलग हैं।

  • इमेज की तरह घोषित होते आइकन

    फ़ोल्डर और फ़ाइल के आइकन आइटम का प्रकार दोहराते हैं। वे aria-hidden हैं, और नाम बताता है कि आइटम क्या है।

नोट्स

इसे बनाना

  • नेस्टेड ul role=group के साथ ब्राउज़र aria-level, aria-setsize और aria-posinset ख़ुद निकाल लेते हैं; इन्हें ख़ुद तभी लगाएँ जब ट्री एक सपाट सूची हो या आइटम धीरे-धीरे लोड करता हो।
  • ऊपर वाला विकल्प चयन को फ़ोकस के साथ चलाता है, जैसा कई फ़ाइल मैनेजर में होता है; जब चुनने से कोई धीमा काम होता हो, जैसे प्रीव्यू लोड होना, तो इसे बंद रखें।
  • टाइप करके पहुँचना फ़ोकस वाले आइटम के अगले आइटम से मिलान शुरू करता है और घूमकर शुरू में लौटता है; आधे सेकंड के अंदर टाइप किए अक्षर एक लंबा उपसर्ग बनाते हैं।
  • विवरण पैनल लाइव रीजन नहीं है: ट्री आइटम पहले ही बता देता है कि वह चुना गया है, और पैनल ट्री के बाद पढ़ने के लिए है।
  • किसी फ़ोल्डर पर क्लिक करने से वह खुलता या बंद होता है और चुना भी जाता है, जैसा ज़्यादातर कोड एडिटर में होता है; ऐरो कुंजियाँ खोलने और चलने को अलग रखती हैं।

स्रोत: WAI-एआरआईए ऑथरिंग प्रैक्टिसेज़: ट्री व्यू · WAI-एआरआईए ऑथरिंग प्रैक्टिसेज़: फ़ाइल डायरेक्टरी ट्री व्यू का उदाहरण

लाइट और डार्क थीम में, डेस्कटॉप और फ़ोन की चौड़ाई पर axe से और कीबोर्ड से जाँचा गया। अभी हर स्क्रीन रीडर और ब्राउज़र जोड़ी के साथ नहीं परखा गया। सुधार बताएँ