Description
Return an empty recommendedAltAttribute when decorative is true, otherwise suppliedAlt.
Accessibility decisions depend on the person, context, content, and relevant design requirements. A supplied measurement or formatting check addresses one condition and cannot establish that an entire interface, sign, or space is accessible.
Return an empty recommendedAltAttribute when decorative is true, otherwise suppliedAlt.
When to use this tool
Use Alternative Text Decorativeflag when you need one documented accessibility component under a supplied criterion.
How to use the tool and how it works
- Enter decorative, suppliedAlt. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read recommendedAltAttribute, nonemptyAltOnDecorative. Inspect nonemptyAltOnDecorative before interpreting the associated values.
Return an empty recommendedAltAttribute when decorative is true, otherwise suppliedAlt. Independently flag a nonempty supplied alternative on a decorative item.1
WAI guidance uses an empty alt value for an image that is decorative in its context. Deciding that role requires judgment about the actual page; the supplied flag cannot make that assessment.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| decorative | Caller-supplied judgment that the image is decorative in its actual context. | Required. Boolean. |
| suppliedAlt | Existing alternative text to inspect; the tool does not interpret the image. | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| recommendedAltAttribute | Empty for a supplied decorative flag; otherwise the supplied text. | Required. Text; maximum UTF-16 length 8192. |
| nonemptyAltOnDecorative | Whether the caller marked the image decorative while supplying nonempty alt text. | Required. Boolean. |
{
"input": {
"decorative": true,
"suppliedAlt": "flourish"
},
"output": {
"recommendedAltAttribute": "",
"nonemptyAltOnDecorative": true
}
} Limitations and assumptions
- The decorative decision is supplied; no image, context, text quality, accessible name, or full accessibility compliance is evaluated.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Evaluate the complete experience with relevant guidance, appropriate expertise, and people who use the access features.
References
-
Calculation and input contract: disability-studies/alternative-text-decorativeflag — tool.io
-
Images Tutorial: Decorative Images — W3C Web Accessibility Initiative
Similar or alternative tools
- Accessible Document Heading Level Step
Return next minus previous and mark skippedLevel only when the next heading descends by more than one level number.
- Access Request Preferred Format
Check exact membership in availableFormats and label available or not listed.