Share menu
Copy the link, share through the device's own sheet, or open any link you give it. A details element: works without script.
Share
Features
- Copy link, the device's share sheet where there is one, and any links you add.
- A details element: it opens and closes without script.
- onMessage hands back what to tell the visitor (Link copied).
Use it for
- Articles, profiles, anything worth passing on.
On this site
- My Stuff: each articleCopy the link, share it from your device, or post it.
- Home: Get in touchPass the site on.
Installation
- Get runets.
git clone https://github.com/ziyam-khan/runets - Copy these files into your project, keeping their folders.
- Install what they use.
pnpm add react lucide-react - Load the styles once. Bring your own base tokens, or use runets’ default theme.
import 'runets/styles/theme.css' import 'runets/styles/kit.css'
API
| Prop | Type | What it does |
|---|---|---|
title / url | string | What is shared. |
links | { label, href }[] | Extra destinations, opened in a new tab. |
onMessage | (text) => void | Feedback for a toast. |
Accessibility
- A native disclosure; every action is a button or a link.
Source
The code is in src/kit/share-menu.tsx in runets, MIT licensed.