Command Palette

Search for a command to run...

Components

Share Menu

A compact share popover with X, LinkedIn, and copy-link actions. Accepts a title and URL and handles encoding automatically.

Features

Installation

1

Run the shadcn CLI command

npx shadcn@latest add @lalit/share-menu
pnpm dlx shadcn@latest add @lalit/share-menu
npx shadcn@latest add @lalit/share-menu
bunx shadcn@latest add @lalit/share-menu

This installs the component directly. Update import paths to match your setup.

Usage

import { ShareMenu } from '@/components/ui/share-menu'

export function Example() {
  return (
    <ShareMenu
      title="Ship your own component registry with shadcn"
      url="https://lalitkakkar.vercel.app/blog/shadcn-custom-registry"
    />
  )
}

API Reference

PropTypeDefaultDescription
title*
stringPage title used as the share text on X and email subject.
url*
stringURL to share. Encoded automatically for each target.
className
stringAdditional classes applied to the trigger button.