Tags

Tags are an interactive, community-generated keyword that allow communities to label, organize, and discover related content. Tags are maintained by their respective communities.

Classes

ClassDescriptionParentModifies
.s-tagBase tag style that is used almost universally.N/AN/A
.s-tag--dismissFor a clear or dismiss action icon. When using this element, it should be rendered as a `button` containing the icon and the parent `.s-tag` should be rendered as a `span` element..s-tagN/A
.s-tag--sponsorCorrectly positions a tag's sponsor logo..s-tagN/A
.s-tag__moderatorExclusively used within Meta communities by moderators (and employees) to assign unique statuses to questions.N/A.s-tag
.s-tag__requiredExclusively used within Meta communities to denote the post type. One of these tags are required on all Meta posts.N/A.s-tag
.s-tag__ignoredPrepends an icon to indicate the tag is ignored.N/A.s-tag
.s-tag__watchedPrepends an icon to indicate the tag is watched.N/A.s-tag
.s-tag__smApply a small size to the tag.N/A.s-tag
.s-tag__lgApply a large size to the tag.N/A.s-tag

Accessibility

Tags should be focusable and navigable with the keyboard. The various tag states (Required, Moderator, Watched, Ignored) are visually distinct but do not include any text indicators for screen readers. For that reason it is recommended to provide additional context using hidden text elements with the v-visible-sr class.

Examples

Default tag

<a class="s-tag" href="#"></a>
<span class="s-tag"><button class="s-tag--dismiss"><span class="v-visible-sr">Dismiss … tag</span></button></span>
<a class="s-tag" href="…"><img class="s-tag--sponsor" src="…"><div class="v-visible-sr">Sponsored tag</div></a>
<span class="s-tag">
    <a href="…"></a>
    <button class="s-tag--dismiss"><span class="v-visible-sr">Dismiss … tag</span></button>
</span>

Moderator

<a class="s-tag s-tag__moderator" href="#">status-completed <div class="v-visible-sr">Moderator tag</div></a>
<span class="s-tag s-tag__moderator">status-bydesign <div class="v-visible-sr">Moderator tag</div><button class="s-tag--dismiss"></button></span>
<a class="s-tag s-tag__moderator" href="#">status-planned <div class="v-visible-sr">Moderator tag</div></a>

Required

<a class="s-tag s-tag__required" href="#">discussion <div class="v-visible-sr">Required tag</div></a>
<span class="s-tag s-tag__required">feature-request <div class="v-visible-sr">Required tag</div><button class="s-tag--dismiss"></button></span>
<a class="s-tag s-tag__required" href="#">bug <div class="v-visible-sr">Required tag</div></a>
discussion
Required tag
Required tag
feature-request
Required tag
Required tag
bug
Required tag
Required tag

Watched

<a class="s-tag s-tag__watched" href="#">asp-net <div class="v-visible-sr">Watched tag</div></a>

Ignored

<a class="s-tag s-tag__ignored" href="#">netscape <div class="v-visible-sr">Ignored tag</div></a>

Sizes

<a class="s-tag s-tag__sm" href="#">css</a>
<a class="s-tag" href="#">css</a>
<a class="s-tag s-tag__lg" href="#">css</a>
ExampleModifier classDescription
css
.s-tag__sm
Apply a small size to the tag.
css
N/A
The default tag size.
css
.s-tag__lg
Apply a large size to the tag.