Componentmedia1.75 KB gzipZero dependencies
ShareMenu
Platform icon row (X, Facebook, LinkedIn, Link) with copy link feedback and stamp stamp.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add share-menuOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { ShareMenu } from "@/components/ui/share-menu"; <ShareMenu onCopy={handleCopy} />Source code
share-menu.tsx + 2 helpersZero 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 />| Prop | Type | Description |
|---|---|---|
| url | string | Configures url. |
| title | string | Primary heading or title text. (Default: "Check this out") |
| label | string | Accessible label text rendered or attached to the control. (Default: "Share") |
| defaultOpen | boolean | Initial open state when uncontrolled. (Default: false) |
| onCopy | (url: string) => void | Callback when link is copied to clipboard. |
| onShare | (platform: "x" | "facebook" | "linkedin" | "email", url: string) => void | Callback invoked on share. |