ShareMenu

A Share button opening intent links for Bluesky, Mastodon, Threads, LinkedIn and X, plus copy link and the system share sheet

Category: overlay · WCAG 2.2-AA · share, social, bluesky, mastodon, threads, linkedin, popover, link

Sizes

States

Props

PropTypeDefaultDescription
urlstring—The page being shared
textstring—Text to post alongside the link (LinkedIn takes none; it reads the page)
itemsArray<'bluesky' | 'mastodon' | 'threads' | 'linkedin' | 'x'>['bluesky', 'mastodon', 'threads', 'linkedin', 'x']The networks offered, in order
size'sm' | 'md'mdVisual size of the component (e.g. 'sm', 'md', 'lg').
labels{ share?: string; copyLink?: string; copied?: string; more?: string; server?: string; shareOn?: (network: string) => string }—Overrides the built-in i18n labels per instance
classNamestring—Class added to the root element

Design tokens

When to use

When not to use

How to build an accessible ShareMenu in React →

Examples

Default

<ShareMenu url="https://cascivo.com/blog/launch" text="cascivo 1.0 is out" />

Chosen networks

Offer only the networks your readers use, in your order

<ShareMenu url={url} items={['bluesky', 'mastodon']} size="sm" />

Just the link

shareIntentUrl builds the same compose link for your own markup; it returns null for Mastodon without a server

import { shareIntentUrl } from './share-menu'

<a href={shareIntentUrl('bluesky', { url, text }) ?? undefined}>Post to Bluesky</a>

Related components

← Back to docs