Componentmedia1.75 KB gzipZero dependencies

ShareMenu

Platform icon row (X, Facebook, LinkedIn, Link) with copy link feedback and stamp stamp.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add share-menu

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { ShareMenu } from "@/components/ui/share-menu"; <ShareMenu onCopy={handleCopy} />

Source code

share-menu.tsx + 2 helpers

Zero third-party dependencies (3 local files shown in tabs below).

tsxshare-menu.tsx199 lines
"use client"; import * as React from "react";import { cn, isSafeUrl } from "./lib/utils";import { useCopy } from "./lib/hooks"; export interface ShareMenuProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onCopy"> {  url?: string;  title?: string;  label?: string;  defaultOpen?: boolean;  onCopy?: (url: string) => void;  onShare?: (platform: "x" | "facebook" | "linkedin" | "email", url: string) => void;} export const ShareMenu = React.forwardRef<HTMLDivElement, ShareMenuProps>(function ShareMenu(  {    url,

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { ShareMenu } from "@/components/ui/share-menu"; <ShareMenu />
PropTypeDescription
urlstringConfigures url.
titlestringPrimary heading or title text. (Default: "Check this out")
labelstringAccessible label text rendered or attached to the control. (Default: "Share")
defaultOpenbooleanInitial open state when uncontrolled. (Default: false)
onCopy(url: string) => voidCallback when link is copied to clipboard.
onShare(platform: "x" | "facebook" | "linkedin" | "email", url: string) => voidCallback invoked on share.