---
title: "Share Button"
description: "A round share button that fans its actions out on an arc, names each on hover, and turns the chosen one into a check. You decide what each action does."
category: "Micro Interactions"
publishedAt: "2026-11-16"
updatedAt: "2026-11-25"
documentation: "https://beui.dev/micro-interactions/share-button"
markdown: "https://beui.dev/micro-interactions/share-button.md"
license: "MIT"
---

# Share Button

> A round share button that fans its actions out on an arc, names each on hover, and turns the chosen one into a check. You decide what each action does.

## Install

```bash
npx shadcn@latest add @beui/share-button
```

## Dependencies

- `clsx`
- `lucide-react`
- `motion`
- `react`
- `tailwind-merge`

## Usage

```tsx
"use client";

import { ShareButton } from "@/components/motion/share-button";

// The button shares nothing itself; each action calls this with its id
// ("copy", "email" or "message"). Return a promise to show the check once
// your share settles.
async function share(_id: string) {
  // Copy a link, open a composer or call your API here.
}

export function ShareButtonUsage() {
  return (
    // The actions fan out above the button; leave room for them.
    <div className="pt-20">
      <ShareButton onAction={share} />
    </div>
  );
}
```

## API Reference

### ShareButton

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `actions` | `ShareAction[]` | — | No | Replace the default copy link, email and message actions. |
| `onAction` | `((id: string) => unknown)` | — | No | Called with the action's id. The button does no sharing of its own: copy the link, open a composer or call your API here. Return a promise to show the check once it settles; if it rejects, the fan stays open. |
| `labels` | `Partial<{ share: string; close: string; copy: string; copied: string; email: string; message: string; }>` | — | No | Override any built-in string, e.g. for translation. |
| `sound` | `boolean` | `false` | No | Play open and close swishes for the fan and a success chime when an action is done. Off by default; a `SoundProvider` can mute it app-wide. |
| `className` | `string` | — | No | Classes merged onto the root element. |

## Types

### ShareAction

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | Unique key, passed to `onAction` when the bubble is pressed. |
| `label` | `string` | Yes | Bubble name, shown beside it on hover or focus and read as its label. |
| `icon` | `ReactNode` | Yes | Icon in the bubble, swapped for a check once the action is done. |
| `doneLabel` | `string` | No | Shown on the label once the action is done, e.g. "Copied". |

## About Share Button

Share Button is a React share control built with Framer Motion. Pressing the round button turns its share mark into a close mark and fans the actions out of it on an arc, each springing out a beat after the last: copy link, email and message by default. Hovering or focusing an action lifts it above its neighbours and shows its name on the outer side of the fan. Choosing one turns its bubble into a check, reading Copied for copy link, then the fan folds back into the button, last out first in. The button does no sharing itself: onAction receives the action's id and you decide what happens.

### When to use it

- A post, product or doc page offers sharing without a modal.
- A dashboard shares a report or invite link.
- Any small set of related actions should open from one button.

### Accessibility

The button reports aria-expanded and is named Share, or Close while open. Every action is a named button; opening by keyboard moves focus to the first, arrow keys walk the fan, and Escape closes and returns focus. While the fan folds home it stops taking input. With reduced motion the actions appear in place without flying.

### FAQ

**How do I make the actions do something?**

Pass onAction. It is called with the action's id, such as copy, email or message; copy the link, open a composer or call your API there. Return a promise to show the check once it settles; if it rejects, the fan stays open.

**Can I change the actions?**

Yes. Pass actions, an array of { id, label, icon, doneLabel }. doneLabel replaces the name once the action is done, like Copied. Three to five actions fit the arc best.

## Source

- Registry detail: https://beui.dev/r/share-button
- Raw source: https://beui.dev/r/share-button/raw
- GitHub: https://github.com/starc007/ui-components
