# ShareMenu

Copy link, the device share sheet when there is one, and configurable targets.

- **Use it for**: Sharing a page or opening a query in another chat: copy link, native share sheet and chosen targets.
- **Not for**: Copying a single value. Try [CopyButton](https://unseenui.com/components/copy-button/).

## Installation

```bash
npm install @stackunseen/ui
```

## Usage

```tsx
import { ShareMenu } from '@stackunseen/ui/navigation';
import { CopyButton } from '@stackunseen/ui';
import '@stackunseen/ui/styles.css';
import '@stackunseen/ui/navigation.css';

<ShareMenu url={pageUrl} title={pageTitle} targets={['copy', 'native', 'linkedin', 'x']} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `copyLabel` | `string` |  |
| `label` | `string` | Names the group, or the menu button. |
| `nativeLabel` | `string` |  |
| `onShare` | `((target: string) => void)` | Called with the target id after a share was requested; a dismissed native share still counts. |
| `presentation` | `"menu" \| "inline"` | Inline buttons, or one Share button that opens a menu. |
| `targets` | `readonly ShareTarget[]` |  |
| `text` | `string` | Accompanies the link where a target takes text, such as email. |
| `title` (required) | `string` |  |
| `url` (required) | `string` |  |

## Keyboard

Buttons and links in a labeled group, or a menu with arrow keys.

## Works with

[DropdownMenu](https://unseenui.com/components/dropdown-menu/), [ContextMenu](https://unseenui.com/components/context-menu/), [NavigationMenu](https://unseenui.com/components/navigation-menu/), [Breadcrumb](https://unseenui.com/components/breadcrumb/), [Pagination](https://unseenui.com/components/pagination/), [Sidebar](https://unseenui.com/components/sidebar/), [Stepper](https://unseenui.com/components/stepper/), [CommandPalette](https://unseenui.com/components/command-palette/), [TableOfContents](https://unseenui.com/components/table-of-contents/), [Tabs](https://unseenui.com/components/tabs/)

Page: https://unseenui.com/components/share-menu/
