Shadcn Social Links
A row of inline-SVG brand tiles (SocialLinks, SocialLink) with expandable share-reveal variants, accessible labels, and safe external link handling.
About Shadcn Social Links
What it is. SocialLinks (and single SocialLink) renders inline-SVG brand tiles for X, GitHub, LinkedIn, YouTube, Instagram, Facebook, Discord, Dribbble, and email across tile, outline, ghost, expand-reveal, and expand-replace variants.
How it is built. Uses bundled inline SVGs (no icon-library dependency), adds aria-label and title per tile, and opens external links in a new tab with rel="noopener noreferrer" while leaving mailto: links in place.
When to use it. Use SocialLinks in footers, author bylines, profile cards, and compact hover-to-share triggers.
For AI agents
Hand your agent this brief or the Markdown page, not a screenshot.
When to use
- Footer social rows (
variant="tile"), author bylines (variant="ghost"), or hover-to-expand share buttons (variant="expand-reveal"/"expand-replace")
When not to use
- OAuth sign-in buttons with text labels — use Button (
variant="auth-social")
Agent notes
- Named exports:
SocialLinks,SocialLinkfrom@/components/custom/blocks/SocialLinksBlock - Pass
linkComponent={Link}fromnext/linkwhen routing internal links;externaldefaults totrue
For AI agents4 variants. Ask the user which one.
Ask before you pick. This page has 4 variants. If the user has not named one and has not asked you to choose for them, ask which they want before you install anything or write code, and show every option with its live link. If they ask you to choose, pick from each variant's best-for and avoid-if lines against their brief, and say why. If the user named a variant, use it and do not ask.
All 4 options as live previews: https://avaraui.com/view/social-links
When to use it. A row of brand marks that link out, drawn as inline SVG so it works with any icon package, in four designs: a plain row of tiles, an outlined row, and two share buttons that expand into the links on hover.
Gotchas
- All four are looks of the one `social-links` item: install it once and set `variant` from the index.
- `links` is `{ network, href, label? }[]` and is drawn in the order given; external links open in a new tab with `rel="noopener noreferrer"` unless turned off.
- `size` (`sm`, `md`, `lg`) and a `ghost` style (no fill until hover) are also available on the row styles; the expandable share buttons take a direction.
The 4 variants
Follow row row
One filled tile per network in a row: the default, with each link carrying an accessible name.
- Best for: a footer or profile that lists your social accounts
- Avoid if: you want a single share button that reveals the links
- Traits: filled tiles, default look
- Install:
npx shadcn@latest add @avara-ui/social-links - Docs section
Outlined row outline
The same row with a border instead of a fill, drawn here with every network at the large size.
- Best for: a lighter, line-style row of social links
- Avoid if: you want filled tiles that stand out
- Traits: border instead of fill, all networks
- Install:
npx shadcn@latest add @avara-ui/social-links - Docs section
Expand and replace share button expand-replace
A share button that hides on hover while the social icons expand out from its exact position.
- Best for: an article or product page where sharing should stay out of the way until needed
- Avoid if: the links must always be visible, or the page is touch-only
- Traits: hover reveal, trigger hides, direction option, default right
- Install:
npx shadcn@latest add @avara-ui/social-links - Docs section
Expandable 4-directional share buttons expand-reveal
An icon-only Share button that expands the social tiles on hover, in any of four directions.
- Best for: a compact share control that opens up to the right, left, above or below
- Avoid if: the links must always be visible, or the page is touch-only
- Traits: hover reveal, icon-only trigger, four directions
- Install:
npx shadcn@latest add @avara-ui/social-links - Docs section
- Markdown
- /docs-md/nextjs-social-links.md
- Install
npx shadcn@latest add https://avaraui.com/r/social-links.json- Registry name
@avara-ui/social-links, through the shadcn MCP server- Index
- llms.txt lists every page, or add the agent skill once
Props Reference
SocialLinks
| Prop | Type | Default | Description |
|---|---|---|---|
links | SocialLink[] | — | The row, in order. See the shape below. |
variant | "tile" | "outline" | "ghost" | "tile" | Soft fill, border, or nothing until hover. |
size | "sm" | "md" | "lg" | "md" | Tile and mark size: 32, 40 or 48px. |
external | boolean | true | Open links in a new tab with rel="noopener noreferrer". mailto: hrefs are exempt. |
linkComponent | React.ElementType | "a" | The element used for each link — pass next/link for internal hrefs. |
className | string | — | Applied to the row; other props are spread there too. |
SocialLink
| Field | Type | Description |
|---|---|---|
network | "x" | "github" | "linkedin" | "youtube" | "instagram" | "facebook" | "discord" | "dribbble" | "email" | Which mark to draw. |
href | string | Where it goes. |
label | string | Accessible name. Defaults to the network's name. |
Works with other components
- Used inside Footer and Profile Card layouts.
- Pair with Tooltip or Copy Button in author/profile headers.
How do I add social media icons to a React site?
Pass a links array to SocialLinks, one entry per network, in the order you want them shown. It covers X, GitHub, LinkedIn, YouTube, Instagram, Facebook, Discord, Dribbble and email. Each is an inline SVG, so no icon font is loaded.
Does SocialLinks require Lucide or another icon package?
No. All nine network marks are bundled as inline SVGs, so icon-library updates never break your social links. The only Lucide import is the Mail icon for the email link, so brand logos never depend on the package.
How do I use Next.js Link for internal social routes?
Pass linkComponent={Link} from next/link and set external={false} when your links include internal URLs. The default element is a plain a, which keeps the component free of any next/* import so it also works in Vite.
How do I change the style and size of the icons?
Use variant with "tile", "outline" or "ghost", which are a soft fill, a border, or nothing until hover. size accepts "sm", "md" or "lg", which render at 32, 40 or 48px. Other props are spread onto the row element.
Do social links open in a new tab safely?
Yes. external defaults to true, which opens links in a new tab with rel="noopener noreferrer". mailto: links are exempt from that behaviour. Set external={false} for same-tab navigation to pages on your own site.