Template:Screen reader-only/doc

From Fanverse
Jump to navigation Jump to search

Template:High-use Template:Template redirect Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab.

This template generates invisible text that will be read aloud by screen readers.

Screen reader only[edit source]

The text supplied as the sole unnamed parameter is not to be displayed in a browser, but should be voiced by a screen reader.

First part. {{Screen reader-only|Second part only for a screen reader.}} Third part. → First part. Second part only for a screen reader. Third part.

Usage[edit source]

This template should only be used to hide text from sighted readers when that text substantially duplicates adjacent text that is visible.

Table captions[edit source]

The main usage case is when a table is placed immediately below a heading, where the heading is effectively identical to the table's caption. This template may be used to hide the caption from a sighted reader (as it would be duplicative), while allowing a screen reader to hear the captionTemplate:Snd for example, if the screen reader reads a list of tables in the article to allow navigation directly to a particular table.

If the table is moved to another location away from the heading, then this template should be removed to allow sighted readers to see the table caption. This is a requirement of WCAG 1.3.1.

Example[edit source]

The table below has a caption "Example table" that will be voiced by a screen reader.

|+ {{Screen reader-only|Example table}}

Example table[edit source]

Example table
Header Information
Row hdr 1 data 1
Row hdr 2 data 2
Row hdr 3 data 3

TemplateData[edit source]

Template:Template parameter usage

TemplateData for Screen reader-only

Template:Sandbox other

<templatedata> { "params": { "1": { "label": "Text", "type": "string", "required": true } }, "format": "inline", "description": "The text supplied is not to be displayed in a browser, but should be voiced by a screen reader." } </templatedata>