"use client";
import { ShareButton } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
title | string | document.title | Title of the shared page (default document.title). |
tone | ButtonTone | sm / neutral / outline | Colour role (neutral, primary, danger, success, warning, info). |
url | string | the current page | URL to share (default: the current page). |
variant | ButtonVariant | sm / neutral / outline | Emphasis (solid, secondary, soft, outline, ghost). |
copiedLabel | ReactNode | "Link copied" from the catalog | Label after the link was copied (default "Link copied" from the catalog). |
failedLabel | ReactNode | from the catalog | Label after sharing and copying failed (default from the catalog). |
iconOnly | boolean | — | Square icon button (fits a row of IconButtons): the current label — share, copied or failed — is its accessible name and title tooltip, and the icon shows the state (check / alert). |
label | ReactNode | "Share" from the catalog | Button label (default "Share" from the catalog). |
notify | boolean | true | Show a toast after copying (needs <ToastProvider />; default true). |
onShare | (result: ShareButtonResult) => void | — | Result callback. |
size | ButtonSize | sm / neutral / outline | Size from the shared scale (xs, sm, md, lg). |
text | string | — | Text shared with the link. |
titledefault document.titlestring
Title of the shared page (default document.title).
tonedefault sm / neutral / outlineButtonTone
Colour role (neutral, primary, danger, success, warning, info).
urldefault the current pagestring
URL to share (default: the current page).
variantdefault sm / neutral / outlineButtonVariant
Emphasis (solid, secondary, soft, outline, ghost).
copiedLabeldefault "Link copied" from the catalogReactNode
Label after the link was copied (default "Link copied" from the catalog).
failedLabeldefault from the catalogReactNode
Label after sharing and copying failed (default from the catalog).
iconOnlyboolean
Square icon button (fits a row of IconButtons): the current label — share, copied or failed — is its accessible name and title tooltip, and the icon shows the state (check / alert).
labeldefault "Share" from the catalogReactNode
Button label (default "Share" from the catalog).
notifydefault trueboolean
Show a toast after copying (needs <ToastProvider />; default true).
onShare(result: ShareButtonResult) => void
Result callback.
sizedefault sm / neutral / outlineButtonSize
Size from the shared scale (xs, sm, md, lg).
textstring
Text shared with the link.
Other props are passed to the root element (ButtonHTMLAttributes<HTMLButtonElement>), including className, style, id and aria-* attributes.
Complex object props use fixed fixtures. Primitive props stay editable.
<ShareButton url="https://example.com/post" title="Release notes" variant="outline" tone="neutral" />const url = "https://pixxl.tools";
const title = "pixxl tools";
<ShareButton url={url} title={title} />
<ShareButton iconOnly url={url} variant="ghost" />const url = "https://pixxl.tools";
const title = "pixxl tools";
<ShareButton url="https://example.com/post" title="Release notes" variant="outline" tone="neutral" />