Check Options

Table of Contents

How Checks Work

Rules in axe-core are made up of one or more individual checks that dictate how the rule works. Each check is typically designed to look for a specific requirement and report back its findings to the rule.

For example, the rule image-alt uses the checks has-alt, aria-label, aria-labelledby, and non-empty-title to determine if the image has an accessible name from an alt, aria-label, aria-labelledby, or title attribute (respectively).

Many checks allow you to change how they work through options properties. These options can be found in the checks metadata file.

For example, the check has-lang takes an attributes option which dictates which attributes to check for a lang value.

To customize a check's options, you can use axe.configure to configure the check and modify the options as desired.

// configure has-lang check to look at the `hreflang` attribute as well
axe.configure({
	checks: [
		{
			id: 'has-lang',
			options: {
				attributes: ['lang', 'xml:lang', 'hreflang']
			}
		}
	]
});

Options

Global Options

All checks allow these global options:

OptionDefaultDescription
reviewOnFailfalseHave the check return as “Needs Review” rather than a violation

aria-allowed-role

OptionDefaultDescription
allowImplicittrueAllow the explicit role to match the implicit role of the element
ignoredTags[]Do not check for allowed roles in the provided HTML elements list

aria-required-children

aria-roledescription

color-contrast

OptionDefaultDescription
ignoreUnicodetrueDo not check the color contrast of Unicode characters
ignoreLengthfalseDo not check the color contrast of short text content
boldValue700The minimum CSS font-weight value that designates bold text
boldTextPt14The minimum CSS font-size pt value that designates bold text as being large
largeTextPt18The minimum CSS font-size pt value that designates text as being large
shadowOutlineEmMax0.1The maximum blur-radius value (in ems) of the CSS text-shadow property. blur-radius values greater than this value will be treated as a background color rather than an outline color.
contrastRatioN/AContrast ratio options
  contrastRatio.normalN/AContrast ratio requirements for normal text (non-bold text or text smaller than largeTextPt)
    contrastRatio.normal.expected4.5The expected contrast ratio for normal text
    contrastRatio.normal.minThresholdN/AThe minimum contrast ratio the check will apply to. Contrast ratios less than this value will be ignored
    contrastRatio.normal.maxThresholdN/AThe maximum contrast ratio the check will apply to. Contrast ratios greater than this value will be ignored
  contrastRatio.largeN/AContrast ratio requirements for large text (bold text or text larger than largeTextPt)
    contrastRatio.large.expected4.5The expected contrast contrast ratio for large text
    contrastRatio.large.minThresholdN/AThe minimum contrast ratio the check will apply to. Contrast ratios less than this value will be ignored
    contrastRatio.large.maxThresholdN/AThe maximum contrast ratio the check will apply to. Contrast ratios greater than this value will be ignored

page-has-heading-one

page-has-main

OptionDefaultDescription
selectormain:not([role]), [role=‘main’]Selector used to determine if a page has a main landmark

page-no-duplicate-banner

OptionDefaultDescription
selectorheader:not([role]), [role=banner]Selector used to determine if a page has a banner landmark
nativeScopeFilterarticle, aside, main, nav, sectionSelector used to ignore banner landmarks that have a parent that matches the selector

page-no-duplicate-contentinfo

OptionDefaultDescription
selectorfooter:not([role]), [role=contentinfo]Selector used to determine if a page has a contentinfo landmark
nativeScopeFilterarticle, aside, main, nav, sectionOption values used to ignore contentinfo landmarks that have a selector matching the parent element

page-no-duplicate-main

OptionDefaultDescription
selectormain:not([role]), [role=‘main’]Selector used to determine if a page has a main landmark

duplicate-img-label

label-content-name-mismatch

OptionDefaultDescription
pixelThreshold0.1Percent of difference in pixel data or pixel width required to determine if a font is a ligature font. Ligature fonts are ignored when comparing the label to the content
occuranceThreshold3Number of times the font is encountered before auto-assigning the font as a ligature or not

has-lang

OptionDefaultDescription
attributes[‘lang’, ‘xml:lang’]Attributes to check for lang values

valid-lang

OptionDefaultDescription
attributes[‘lang’, ‘xml:lang’]Attributes to check for valid lang values
valueArray of all valid langsList of valid lang values

frame-tested

OptionDefaultDescription
isViolationfalseIf an iframe that has not been injected with axe-core should be reported as a violation

no-autoplay-audio

OptionDefaultDescription
allowedDuration3Maximum time in seconds an audio clip may autoplay before being marked as violation

css-orientation-lock

OptionDefaultDescription
degreeThreshold3The difference of degrees from 180 and 90 that are considered locked to a specific display orientation (for example, 93° rotated is not considered locked while 94° is)

meta-viewport-large

OptionDefaultDescription
scaleMinimum5The scale-maximum CSS value of the check applies to. Values above this number will be ignored
lowerBound2The scale-minimum CSS value the check applies to. Values below this number will be ignored

meta-viewport

OptionDefaultDescription
scaleMinimum2The scale-maximum CSS value the check applies to. Values above this number will be ignored

header-present

landmark

OptionDefaultDescription
selectormain, [role=main]Selector used to determine if a page has a landmark region

p-as-heading

avoid-inline-spacing

OptionDefaultDescription
cssProperties[‘line-height’, ‘letter-spacing’, ‘word-spacing’]List of inline spacing CSS properties to flag

scope-value

OptionDefaultDescription
values[‘row’, ‘col’, ‘rowgroup’, ‘colgroup’]List of valid scope values

region

OptionDefaultDescription
regionMatcherdialog, [role=dialog], svgA matcher object or CSS selector to allow elements to be treated as regions