Skip to content

Visibility

Visibility utilities show or hide content in different ways. invisible hides an element but keeps its space, visible restores it, visually-hidden hides content on screen while keeping it for screen readers, and visually-hidden-focusable reveals it again when it receives keyboard focus.

1Visible and invisible

invisible hides an element but keeps its space; visible shows it again.

visible
visible

2Invisible versus d-none

Compare: invisible leaves a gap, d-none closes it.

A
C
A
B d-none
C

3Hidden label for an input

visually-hidden hides the label on screen while screen readers still announce it.

4Skip link

visually-hidden-focusable shows a skip link only when it receives keyboard focus. Press Tab inside this example.

5Icon button with hidden text

The icon is aria-hidden and a visually-hidden span names the button.

6Counter with context

A badge reads "5 unread messages" to screen readers while showing only the number.

7Keep alignment with invisible icons

An invisible check icon keeps unchecked rows aligned with the checked one.

  • Newest first
  • Oldest first
  • Most popular

8Hidden table caption

A visually-hidden caption describes the table for assistive technology.

Monthly visits by city
CityVisits
Copenhagen30.1k
Dublin62.0k

9Hidden section heading

A visually-hidden heading gives a visual-only card grid a name in the outline.

Featured services

Guided tours
Guided tours
Airport transfers

10Spinner with a hidden status

The spinner's text is visually-hidden inside role="status".

Loading orders
Fetching the latest data

11Rating for screen readers

Stars are hidden from assistive tech and a visually-hidden text states the score.

Rated 3 out of 5 (144)

12Old and new price

visually-hidden words tell which price is the original and which the sale price.

Original price:$126.12Sale price:$49.11

13Reserved space for errors

An invisible error line keeps the form from jumping when the message appears.

14Current page in pagination

A visually-hidden "(current)" marks the active page for screen readers.

15External link hint

An outward arrow icon plus a visually-hidden note about the link destination.

16Progress with hidden value

The progress bar shows the fill; the percentage is a visually-hidden text.

64% uploaded

17Back to top link

A visually-hidden-focusable link at the end of a long page only shows for keyboard users.

Our team has done this many times, so you never have to guess. Family rooms, adults-only retreats and pet-friendly stays in one search.

Back to top

18Placeholder column

An invisible column keeps a three column layout balanced while one is empty.

col
col

19Hidden legend

A visually-hidden legend names a radio group whose visual heading is elsewhere.

Delivery speed

20Close button label

btn-close has no text, so it needs aria-label; a visually-hidden span is the alternative for custom close icons.

The world is waiting for you