Skip to content
Aback UI

Share Buttons

Share links for X, LinkedIn, and more, with copy link and the native share sheet.

BetaUsed in Aback Tools, Aback LaunchRegistry JSON (opens in a new tab)
XLinkedIn

Installation

Copy the source with the CLI to own and edit it, or import it from the npm package.

npx aback-ui@latest add share-buttons

Writes components/ui/share-buttons.tsx and the components it builds on. First time in this project? Run npx aback-ui@latest init first, as the installation guide shows.

Usage

Import the parts you need from the installed file. The Code tab above has a complete, working example.

tsx
import { ShareButtons, shareUrl } from "@/components/ui/share-buttons";

API reference

Props and composition points for Share Buttons. Native element props pass through.

PropTypeDefaultDescription
url / titlestring / stringNoneThe absolute URL to share, and the text or subject where a network supports it. url is required.
networks("x" | "linkedin" | "facebook" | "whatsapp" | "reddit" | "email")[]["x", "linkedin"]Which share links to render, in order.
copyLink / nativeShareboolean / booleantrue / falseAdd a copy-link button, and a native share button where the browser offers the Web Share API.
showLabelsbooleanfalseShow network names next to the icons.
shareUrl(network, url, title)functionNoneThe exported URL builder, for your own share layout.

Dependencies: @tabler/icons-react, plus the shared @/lib/utils helper.

Accessibility

Semantics, keyboard behavior, and the decisions that keep the component operable.

  • The controls are a named group, and every icon-only link has a name such as Share on LinkedIn.
  • Network links are plain anchors that open in a new tab with noopener. Nothing loads from a third party until someone chooses to share.
  • Copy link announces the result through Copy Button's live region.
  • The native share button only renders where the browser supports it, so there is never a dead control.

Used in production

The Aback products whose interfaces shaped this component.