<!-- Generated by scripts/gen-docs.mts from the JSDoc in registry/. Do not edit; run `pnpm run docs`. -->

# share

Shares a link through the system's share sheet, or copies it where there is none, and says which happened. Call it from a click: browsers open the share sheet only for one. It never throws.

```tsx
import { share } from "@/lib/ouro/share";
```

## Example

```tsx
const result = await share({ url: location.href, title: document.title });
if (result === "copied") toast("Link copied");
```

## Use instead when

- Use `ShareButton` instead for the whole button, with its "Link copied" confirmation.

## Parameters

| Parameter | Type |
| --- | --- |
| `data` | `ShareContent` |

## Returns

`Promise<ShareResult>`
