Preview brand Custom

Share bar

Sharing without tracking scripts: the device's own share sheet where there is one, ordinary links everywhere else.

When to use it

  • At the end of something written to be passed on: an article, a guide.
  • Every article on a Somnia site has it, from the article template.

Use something else when:

  • The page is one to keep rather than pass on (a yacht, a quote, a legal page): the print button.
  • You want people to follow the business: the social icons in the footer.

How it works

  1. Where the browser supports the Web Share API (phones, Safari and Chrome), a Share button opens the device's own share sheet. Elsewhere that button isn't shown.
  2. Everywhere, Copy link, which says "Link copied" for two seconds, and plain links to LinkedIn, Bluesky and email. The links work without JavaScript.
  3. Clicks are counted by Umami without cookies or personal data.

No social-network scripts are loaded, so the share bar adds nothing to the page's privacy notice or security policy. It is left off the printed page and out of site search.

Do and don't

Do

  • Give it the page's own title and address
  • Keep it after the article, where someone has read enough to pass it on

Don't

  • Load a network's own share button or script
  • Show share counts
  • Float it over the text

Accessibility

What it does for you

  • A heading, then real buttons and links with their words visible; the icons are decoration.
  • Links that leave the site say "(opens in a new tab)" to a screen reader.
  • Copy link changes its words to "Link copied" for two seconds and announces it, without moving focus.
  • Each is 38px high, with 10px between.
  • The links work without script. Share appears only where the device has a share sheet.

What you need to do

  • The page’s own title and address.
  • A page with two share bars would have two headings with the same words: use one.

Keyboard

KeyWhat it does
TabThrough Share (where shown), Copy link, LinkedIn, Bluesky and Email.
Enter or SpaceOn Share and Copy link: does it.
EnterOn a link: opens it.

What a screen reader is told

  • A heading, "Share this article".
  • Buttons and links named by their words; "LinkedIn (opens in a new tab)".
  • After copying: "Link copied to the clipboard".

This is what the browser reports to assistive technology. What each screen reader then says varies, and has not been listened to yet.

WCAG 2.2

CriterionLevelHow this meets it
1.3.1 Info and RelationshipsAA heading names the group.
2.1.1 KeyboardANative buttons and links.
2.5.3 Label in NameAEach name starts with its visible word.
2.5.8 Target Size (Minimum)AA38px high.
3.2.2 On InputANothing happens until one is pressed.
4.1.3 Status MessagesAAThe copy is announced without moving focus.

The criteria this component has a part in. A page that uses it still has to meet the rest.

Checked

CheckHowResult
Automated (axe-core)WCAG 2.0, 2.1 and 2.2 rules at A and AA, the page in light and in darkPassed
Nothing found, light or dark
Narrow screenNo sideways scrolling at 320px wide (WCAG 1.4.10)Passed
No sideways scrolling
Keyboard and what the browser reportsReal key presses on the live example, and the role, name and state given to assistive technologyPassed
7 of 7 checks pass
On paperSomnia’s print check: no overlaps, stranded headings or controls on the pagePassed
No faults on 5 sheets
Screen readerListened to by a person, in VoiceOver and NVDANot yet
Not yet checked by a person

The 7 checks made with the keyboard, on the example at the top of this page:

  • Passed Tab goes through Copy link, LinkedIn, Bluesky and Email, in that order
  • Passed Copy link is a button and the others are links, under a heading
  • Passed Links that leave the site say they open in a new tab
  • Passed Enter on Copy link copies the address, says "Link copied" on the button and announces it, and focus stays
  • Passed After two seconds the words go back, and the announcement is emptied so a second copy is announced too
  • Passed The links are plain links that work without script
  • Passed Each is at least 24px high, with space between

Run by script on against Somnia DS 1.89.0, in Chromium with axe-core 4.14.0. How these checks work, and every component's results.

Not yet checked

  • How it sounds in a screen reader (VoiceOver, NVDA, TalkBack) has not been checked by a person. The roles, names and states the browser reports are checked by script; what is actually spoken is not.
  • Windows high contrast (forced colours) has not been looked at by a person.
  • The device’s own share sheet belongs to the device: it has not been tried with a screen reader on an iPhone or an Android phone.
  • People looking at the screen aren’t told that LinkedIn and Bluesky open a new tab: the words are for screen readers only.

Evidence

Where it's used

WhereFor
mediadreams.co.ukEvery Insight.
Headland YachtingEvery Destinations and Advice article.

What we saw, and what changed

WhenWhat we sawWhat changed
In these docs it was not shown in both themes.Shown in light and dark, in the brand being previewed (1.4.0).
Its title was in capitals.Sentence case, in the heading face, like the side panels’ titles (1.7.0).
Writing this page’s checks: the announcement stayed in place after the words went back, so copying a second time would not be announced again.It is emptied with the words (1.82.0).

From building and using it on real sites, each entry taken from the changelog or the build's own notes. This is observation by the studio and its clients, not research sessions with users.

What it rests on

What we don't know yet

  • Each button sends an event to the site’s analytics. The numbers have not been looked at, so which of them people use isn’t known.