Share Buttons
Share Buttons for links
Installation
Add the following shadcn UI components:
Add the necessary shadcn/ui components using your preferred package manager:
Add useShareButton hook
Create a new file called useShareButton.ts in your hooks directory:
hooks/useShareButton.ts
Usage
Create a new file called page.tsx in your pages directory:
pages/page.tsx
ShareButton Props
| Name | Type | Default | Description |
|---|---|---|---|
tooltip | string | "Share Page" | Tooltip text for the share button |
className | string | "" | Additional classes for the share button |
size | ButtonProps["size"] | "icon" | Size of the share button |
variant | ButtonProps["variant"] | "default" | Variant of the share button |