लिंक के शब्दों को बताना चाहिए कि वह कहाँ ले जाता है, स्क्रीन रीडर की लिंक सूची में अकेले पढ़े जाने पर भी: फ़ाइल अपना प्रकार और आकार बताती है, और नया टैब खुलने से पहले बताता है।टेक्स्ट के अंदर के लिंक अंडरलाइन हैं, इसलिए वे कभी रंग पर निर्भर नहीं रहते, और जो चीज़ कहीं ले जाने के बजाय पेज पर कुछ करती है, वह बटन है।
इसे माउस, कीबोर्ड या स्क्रीन रीडर से इस्तेमाल करें।साथ का इंस्पेक्टर दिखाता है कि आपके इस्तेमाल के दौरान ब्राउज़र सहायक तकनीक को क्या बताता है: फ़ोकस, स्थिति में बदलाव और घोषणाएँ।
जावास्क्रिप्ट के बिना डेमो उतना ही काम करता है जितना उसका एचटीएमएल; इंस्पेक्टर के लिए जावास्क्रिप्ट चाहिए।
कीबोर्ड
जिन कुंजियों पर यह काम करता है
हर क्रिया पॉइंटर के बिना काम करती है।
कुंजी
यह क्या करती है
TabयाShift+Tab
पढ़ने के क्रम में लिंक और बटनों पर ले जाता है, हर एक पर दिखने वाली फ़ोकस रिंग के साथ।
Enter
फ़ोकस वाले लिंक को खोलता है। बाहरी लिंक नए टैब में खुलता है; डेमो के अपने पेज यहाँ मौजूद नहीं हैं, इसलिए एक नोट बताता है कि क्या होता।
EnterयाSpace
बटन पर, इसी पेज पर अपना काम करता है: लिंक कॉपी करता है, या लिंक के नामों की सूची दिखाता है।
स्क्रीन रीडर
यह क्या घोषित करता है
मार्कअप की भूमिकाओं, नामों और स्थितियों से लिखा गया।
कब
अपेक्षित घोषणा
Tab पहले लिंक तक पहुँचता है
हमने गाँव कैसे चुने, लिंक
Tab बाहरी लिंक तक पहुँचता है
IMD पुणे से बारिश का डेटा (नए टैब में खुलता है), लिंक
Tab डाउनलोड तक पहुँचता है
सालाना रिपोर्ट 2025–26, पीडीएफ़, 2.4 MB, लिंक
Tab किसी "और पढ़ें" लिंक तक पहुँचता है
और पढ़ें खटाव की जल समितियों के बारे में, लिंक
इस अपडेट का लिंक कॉपी करें दबाया जाता है
लिंक कॉपी हो गया
ये अपेक्षित घोषणाएँ हैं, रिकॉर्डिंग नहीं।स्क्रीन रीडर और ब्राउज़र के हिसाब से शब्द और क्रम बदलते हैं।
कोड
कोड कॉपी करें
वही फ़ाइलें जिन पर यह डेमो चलता है।स्टाइल एक प्रीफ़िक्स के साथ परोसी जाती हैं जो इस साइट की अपनी स्टाइल को डेमो से दूर रखता है; आप जो कॉपी करते हैं वह मूल है।
मार्कअप
<div class="ap-links" data-ap-links>
<article class="ap-links__card">
<p class="ap-links__kicker">Annual update</p>
<h3 class="ap-links__name">A year of village ponds</h3>
<p class="ap-links__text">This year our volunteers cleared silt from 42 ponds across Satara and Sangli, and the monsoon filled every one. Read <a href="/ponds/how-we-chose/">how we chose the villages</a>, or see this year's <a href="https://www.imdpune.gov.in/" target="_blank" rel="noopener">rainfall data from IMD Pune<svg class="ap-links__ext" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg><span class="ap-links__vh"> (opens in a new tab)</span></a>.</p>
<a class="ap-links__file" href="/reports/annual-report-2025-26.pdf" download>
<span class="ap-links__badge" aria-hidden="true" translate="no">PDF</span>
<span class="ap-links__file-text">
<span class="ap-links__file-name">Annual report 2025–26<span class="ap-links__vh">,</span></span>
<span class="ap-links__file-meta">PDF, 2.4 MB</span>
</span>
<svg class="ap-links__dl" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M12 4v11M7 10l5 5 5-5M5 20h14"/></svg>
</a>
<h4 class="ap-links__sub">More from the field</h4>
<ul class="ap-links__stories">
<li class="ap-links__story">
<p class="ap-links__story-name">Water committees run by women</p>
<p class="ap-links__story-text">Nine villages in Khatav now look after their own ponds.</p>
<a class="ap-links__more" href="/stories/water-committees/">Read more<span class="ap-links__vh"> about the water committees in Khatav</span><svg class="ap-links__arrow" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M5 12h14M13 6l6 6-6 6"/></svg></a>
</li>
<li class="ap-links__story">
<p class="ap-links__story-name">Birds are back at the ponds</p>
<p class="ap-links__story-text">Volunteers counted 61 species in one January weekend.</p>
<a class="ap-links__more" href="/stories/bird-count/">Read more<span class="ap-links__vh"> about the bird count</span><svg class="ap-links__arrow" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M5 12h14M13 6l6 6-6 6"/></svg></a>
</li>
</ul>
<h4 class="ap-links__sub">Link or button?</h4>
<div class="ap-links__versus">
<div class="ap-links__case">
<p class="ap-links__case-k">Goes to another page: a link</p>
<a class="ap-links__more" href="/projects/">View all projects<svg class="ap-links__arrow" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M5 12h14M13 6l6 6-6 6"/></svg></a>
</div>
<div class="ap-links__case">
<p class="ap-links__case-k">Does something here: a button</p>
<button type="button" class="ap-btn ap-links__copy"><svg class="ap-btn__icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg>Copy link to this update</button>
</div>
</div>
<p class="ap-links__status" role="status"></p>
</article>
<div class="ap-links__names">
<button type="button" class="ap-links__reveal" aria-expanded="false" aria-controls="links-list">
<span>Show these links as a screen reader lists them</span>
<svg class="ap-links__chevron" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m6 9 6 6 6-6"/></svg>
</button>
<div class="ap-links__panel" id="links-list" hidden>
<p class="ap-links__panel-k">Each link's name, out of context:</p>
<ol></ol>
</div>
</div>
</div>
/**
* Links that say where they go: a content card whose links carry their
* purpose in their text (visually hidden where needed), plus a button for an
* action on the page and a view of the card's links as a links list shows them.
*
* Markup: [data-ap-links] holding the card's links, a button.ap-links__copy,
* a button.ap-links__reveal[aria-expanded][aria-controls] for the list, and a
* role=status line. The links point at pages this demo does not have, so
* the script keeps them on the page and says so; the external one opens.
*/
export function init(root) {
const status = root.querySelector("[role=status]");
const reveal = root.querySelector(".ap-links__reveal");
const panel = document.getElementById(reveal.getAttribute("aria-controls"));
const names = panel.querySelector("ol");
const card = root.querySelector(".ap-links__card");
// Clear first, so the same message is announced again on a second press.
function say(text) {
status.textContent = "";
requestAnimationFrame(() => { status.textContent = text; });
}
// Roughly what a screen reader's links list shows: each link's text,
// visually hidden parts included, aria-hidden parts left out.
function nameOf(link) {
const copy = link.cloneNode(true);
for (const hidden of copy.querySelectorAll("[aria-hidden='true']")) hidden.remove();
return copy.textContent.replace(/\s+/g, " ").trim();
}
function showNames(open) {
reveal.setAttribute("aria-expanded", String(open));
panel.hidden = !open;
if (open) names.replaceChildren(...[...card.querySelectorAll("a[href]")].map((link) => {
const item = document.createElement("li");
item.textContent = nameOf(link);
return item;
}));
}
async function copyLink() {
try {
await navigator.clipboard.writeText(location.href.split("#")[0]);
say("Link copied");
} catch {
say("Could not copy the link");
}
}
function onClick(event) {
if (event.target.closest(".ap-links__copy")) {
copyLink();
return;
}
if (event.target.closest(".ap-links__reveal")) {
showNames(reveal.getAttribute("aria-expanded") !== "true");
return;
}
const link = event.target.closest("a[href]");
if (!link || link.target === "_blank") return;
// The demo's own pages do not exist here: stay, and say what would happen.
event.preventDefault();
say(link.hasAttribute("download") ? "In a real site this link downloads the PDF." : "In a real site this link opens that page.");
}
root.addEventListener("click", onClick);
return () => root.removeEventListener("click", onClick);
}
for (const root of document.querySelectorAll("[data-ap-links]")) init(root);
कहीं जाना लिंक है और यहीं कुछ करना बटन, इसलिए हर एक उसी भूमिका से घोषित होता है जिसकी लोग उम्मीद करते हैं।
उपयोग
इसे कब इस्तेमाल करें
इसे अपनाएँ
लिंक वाला कोई भी टेक्स्ट: लेख, कार्ड, मदद के पेज, ईमेल।
टीज़र की सूचियाँ जिनमें हर आइटम "और पढ़ें" पर ख़त्म होता है।
कुछ और इस्तेमाल करें
पेज पर होने वाली क्रियाएँ, जैसे कॉपी करना, पैनल खोलना या फ़ॉर्म भेजना: बटन इस्तेमाल करें।
हर बाहरी लिंक के लिए नया टैब खोलना: ऐसा तभी करें जब पेज छोड़ने से किया हुआ काम खो जाए।
आम विफलताएँ
आमतौर पर यह कहाँ गलत होता है
"यहाँ क्लिक करें" और "और पढ़ें"
लिंक की सूची में दस "और पढ़ें" लिंक दस एक जैसे विकल्प हैं। नज़र से छिपे शब्द हर एक को बताने देते हैं कि वह किस बारे में है।
सिर्फ़ रंग से दिखाए गए लिंक
धूसर टेक्स्ट में नीला टेक्स्ट कई लोगों के लिए पहचानना मुश्किल है, और कुछ के लिए नामुमकिन। अंडरलाइन किसी भी रंग में लिंक को चिह्नित करती है।
बिना चेतावनी के नया टैब
बैक बटन काम करना बंद कर देता है और स्क्रीन रीडर उपयोगकर्ता शायद नया टैब नोटिस न करें। यह लिंक शब्दों में और एक आइकन से बताता है कि वह नया टैब खोलता है।
चौंकाने वाले डाउनलोड
बड़ा डाउनलोड शुरू करने वाला, या फ़ोन पर पीडीएफ खोलने वाला लिंक समय और डेटा खर्च करता है। प्रकार और आकार बताने से लोग चुन पाते हैं।
बटन की तरह काम करने वाला लिंक
href="#" वाला लिंक जो कुछ कॉपी करे या खोले, लिंक के रूप में घोषित होता है, इसलिए लोग कहीं जाने की उम्मीद करते हैं। बटन इस्तेमाल करें।
दिखने वाले शब्दों की जगह लेने वाला aria-label
"और पढ़ें" दिखाने वाले लिंक पर aria-label="Water committees" वॉइस कंट्रोल तोड़ देता है। इसके बजाय दिखने वाले शब्दों के बाद छिपे शब्द जोड़ें।
नोट्स
इसे बनाना
नज़र से छिपा टेक्स्ट डिज़ाइन को छोटा रखते हुए स्क्रीन रीडर उपयोगकर्ताओं को पूरा नाम देता है; उसे दिखने वाले शब्दों के बाद रखें ताकि नाम अब भी उसी से शुरू हो जो लोग देखते हैं।
निजता के लिए ब्राउज़र :visited को सिर्फ़ रंग बदलने देते हैं, इसलिए लिंक को चिह्नित करने का काम अंडरलाइन करती है और विज़िटेड रंग एक अतिरिक्त संकेत है।
download एट्रिब्यूट ब्राउज़र से फ़ाइल खोलने के बजाय सेव करने को कहता है; लिंक में प्रकार और आकार होने से लोग टैप करने से पहले तय कर सकते हैं।
ऊपर की सूची हर लिंक के टेक्स्ट से बनती है, aria-hidden वाले हिस्से छोड़कर, जो मोटे तौर पर वही है जो स्क्रीन रीडर की लिंक सूची दिखाती है।
लाइट और डार्क थीम में, डेस्कटॉप और फ़ोन की चौड़ाई पर axe से और कीबोर्ड से जाँचा गया।अभी हर स्क्रीन रीडर और ब्राउज़र जोड़ी के साथ नहीं परखा गया।सुधार बताएँ