Entry Post

Entry Module
Entry
Main Post Title

Accessible Name and Friendly Name

Post Header Aside
Comments Actions Snippet
Comments Population
Comment Creation

Post Content

If a component is significant enough, it must contain a component name in the form of a heading element (e.g., h1).

But sometimes there’s a big tone discrepancy between the name of the component and what you want to say in the heading. Consider this example:

<div class="registration-component"> <h1>Welcome! Please register.</h1> <form>...</form>
</div>

Although, the context of a registration component is mentioned both in the class name and in the heading element, it still fails in providing an official name for the component which can be crawled by search engines and read by screenreaders.

The Solution

It would be what we call an accessible name. It is a formal name for the component inside a heading tag. In the existing example, the heading with the brand tone or voice would be a friendly name wherein we can get creative about.

Here’s a better example of that registration component:

<div class="registration-component"> <h1 class="accessible-name">Registration Component</h1> <p class="friendly-name">Welcome! Please register.</p> <form>...</form>
</div>

In CSS, we could visually hide the accessible name and always use a friendly name even if they both have the same content (mostly for HTML markup consistency).

Comment Module
Comments
Comments
Comments Actions Snippet
Comments Population
Comment Creation

There are no comments.

Comment Creation
Compose Comment