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
- 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.
- Everywhere, Copy link, which says "Link copied" for two seconds, and plain links to LinkedIn, Bluesky and email. The links work without JavaScript.
- 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
| Key | What it does |
|---|---|
| Tab | Through Share (where shown), Copy link, LinkedIn, Bluesky and Email. |
| Enter or Space | On Share and Copy link: does it. |
| Enter | On 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
| Criterion | Level | How this meets it |
|---|---|---|
| 1.3.1 Info and Relationships | A | A heading names the group. |
| 2.1.1 Keyboard | A | Native buttons and links. |
| 2.5.3 Label in Name | A | Each name starts with its visible word. |
| 2.5.8 Target Size (Minimum) | AA | 38px high. |
| 3.2.2 On Input | A | Nothing happens until one is pressed. |
| 4.1.3 Status Messages | AA | The 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
| Check | How | Result |
|---|---|---|
| Automated (axe-core) | WCAG 2.0, 2.1 and 2.2 rules at A and AA, the page in light and in dark | Passed Nothing found, light or dark |
| Narrow screen | No sideways scrolling at 320px wide (WCAG 1.4.10) | Passed No sideways scrolling |
| Keyboard and what the browser reports | Real key presses on the live example, and the role, name and state given to assistive technology | Passed 7 of 7 checks pass |
| On paper | Somnia’s print check: no overlaps, stranded headings or controls on the page | Passed No faults on 5 sheets |
| Screen reader | Listened to by a person, in VoiceOver and NVDA | Not 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
| Where | For |
|---|---|
| mediadreams.co.uk | Every Insight. |
| Headland Yachting | Every Destinations and Advice article. |
What we saw, and what changed
| When | What we saw | What 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
- MDN: Web Share API: Sharing goes through the operating system’s own share mechanism to a target the person picks, and has to start from a press.
- WCAG technique G201: Giving users advanced warning when opening a new window: Say in the link that it opens a new window or tab.
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.