Skip to content

Commit

Permalink
[Docs] label-has-associated-control: add line breaks for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
lb- authored and ljharb committed Oct 23, 2024
1 parent 30d2318 commit 0bc6378
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/rules/label-has-associated-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,13 @@ This rule takes one optional object argument of type object:
```

`labelComponents` is a list of custom React Component names that should be checked for an associated control.

`labelAttributes` is a list of attributes to check on the label component and its children for a label. Use this if you have a custom component that uses a string passed on a prop to render an HTML `label`, for example.

`controlComponents` is a list of custom React Components names that will output an input element. [Glob format](https://linuxhint.com/bash_globbing_tutorial/) is also supported for specifying names (e.g., `Label*` matches `LabelComponent` but not `CustomLabel`, `????Label` matches `LinkLabel` but not `CustomLabel`).

`assert` asserts that the label has htmlFor, a nested label, both or either. Available options: `'htmlFor', 'nesting', 'both', 'either'`.

`depth` (default 2, max 25) is an integer that determines how deep within a `JSXElement` label the rule should look for text content or an element with a label to determine if the `label` element will have an accessible label.

### Fail
Expand Down

0 comments on commit 0bc6378

Please sign in to comment.