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

Installation

  1. Get runets.
    git clone https://github.com/ziyam-khan/runets
  2. Copy these files into your project, keeping their folders.
  3. Install what they use.
    pnpm add react lucide-react
  4. 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

PropTypeWhat it does
title / urlstringWhat is shared.
links{ label, href }[]Extra destinations, opened in a new tab.
onMessage(text) => voidFeedback for a toast.

Accessibility

Source

The code is in src/kit/share-menu.tsx in runets, MIT licensed.