Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 982 Bytes

no-empty-components.md

File metadata and controls

49 lines (34 loc) · 982 Bytes

FluentUI components should not be empty (@microsoft/fluentui-jsx-a11y/no-empty-components)

💼 This rule is enabled in the ✅ recommended config.

Provide labels to identify all form controls, including text fields, checkboxes, radio buttons, and drop-down menus. In most cases, this is done by using the label element.

https://www.w3.org/WAI/tutorials/forms/labels/

Rule Details

This rule aims to prevent missing text and info for users.

Examples of incorrect code for this rule:

<Text></Text>
<Label></Label>
<Breadcrumb></Breadcrumb>

Examples of correct code for this rule:

<Label size="small">Small</Label>
<Label size="small">Small</Label>
<Text>This is an example of the Text component's usage.</Text>
<Breadcrumb>
    <BreadcrumbItem>
        <BreadcrumbButton>Item 1</BreadcrumbButton>
    </BreadcrumbItem>
</Breadcrumb>