Xzero UI
Pro library

Share sheetPro

A Share button that opens into a panel with copy link, access level, channels, and people to send to.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/share-sheet
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/share-sheet

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { ShareSheet } from "@/components/xzero/share-sheet/share-sheet";
import { Globe, Lock, Mail, MessageSquare } from "lucide-react";

export function DocumentShare() {
  return (
    <ShareSheet
      title="Q3 roadmap"
      link="https://example.com/d/q3-roadmap"
      people={[
        { id: "ana", name: "Ana Ruiz", avatar: "/avatars/ana.jpg" },
        { id: "sam", name: "Sam Lee", avatar: "/avatars/sam.jpg" },
      ]}
      access={[
        { value: "team", label: "Team", description: "Anyone on the team can view", icon: <Lock size={16} /> },
        { value: "public", label: "Anyone with the link", description: "Can view and comment", icon: <Globe size={16} /> },
      ]}
      channels={[
        { id: "slack", label: "Slack", doneLabel: "Posted", icon: <MessageSquare size={16} /> },
        { id: "email", label: "Email", doneLabel: "Sent", icon: <Mail size={16} /> },
      ]}
      onSend={({ people, access }) => api.share(people.map(person => person.id), access)}
      onChannel={channel => api.post(channel)}
    />
  );
}

API reference

ShareSheet

A Share button that springs open into a share panel (copy link, access level, channels, recent people) and folds into a sent confirmation.

PropTypeDefaultDescription
title (required)string–Name of the thing being shared, shown in the panel title as Share "title".
link (required)string–The URL shown in the link row and written to the clipboard by Copy.
people (required)SharePerson[]–Recent people: { id, name, avatar }. Picking one flies its avatar up into the Send to row.
access (required)ShareSheetAccess[]–Access levels: { value, label, description, icon } (the type was ShareAccess, kept as a deprecated alias). Shown in a listbox under the link.
channelsShareChannel[][]Channel buttons: { id, label, icon, doneLabel }. doneLabel is shown once onChannel resolves; keep it about as long as label.
defaultAccessstring–Starting access value. Defaults to the first entry in access.
onSend(submission: ShareSubmission) => void | Promise<unknown>–Receives { people, access }. A returned promise holds the sending state; a rejection keeps the panel open with an error.
onChannel(channel: string) => void | Promise<unknown>–Called with the channel id. A promise holds that button's pending state; a rejection shows Failed on it.
onCopy(access: string) => void–Called after the link is copied, with the access level it was copied under.
labelstring"Share"Trigger button text.
align"start" | "end" | "center""end"Which edge of the button stays put while the panel grows. center grows it evenly around the button and folds it back the same way.
sheetOnPhonesbooleantrueUp to 520px wide the panel opens as a bottom sheet over a dimmed backdrop: it slides up, drags down from its grabber, and closes on Esc, a tap outside or Done.
classNamestring–Class on the root.

Keyboard interactions

KeysAction
Enter / SpaceOpens the panel from the Share button, or presses the focused control.
EscapeCloses the access list first, then folds the panel back into the button and returns focus to it.
ArrowUp / ArrowDown / ArrowLeft / ArrowRightMoves between access options in the open list, looping at the ends.
TabMoves through the copy, access, channel, people, and send controls.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in docks and tabs

Guidance for AI tools

Share sheet: A Share button that opens into a panel with copy link, access level, channels, and people to send to. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components