Avara UI

Shadcn Social Links

A row of inline-SVG brand tiles (SocialLinks, SocialLink) with expandable share-reveal variants, accessible labels, and safe external link handling.

Applies to this page's previews only

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, SocialLink from @/components/custom/blocks/SocialLinksBlock
  • Pass linkComponent={Link} from next/link when routing internal links; external defaults to true
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

  1. 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
  2. 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
  3. 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
  4. 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
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

PropTypeDefaultDescription
linksSocialLink[]—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.
externalbooleantrueOpen links in a new tab with rel="noopener noreferrer". mailto: hrefs are exempt.
linkComponentReact.ElementType"a"The element used for each link — pass next/link for internal hrefs.
classNamestring—Applied to the row; other props are spread there too.
FieldTypeDescription
network"x" | "github" | "linkedin" | "youtube" | "instagram" | "facebook" | "discord" | "dribbble" | "email"Which mark to draw.
hrefstringWhere it goes.
labelstringAccessible name. Defaults to the network's name.

Works with other components

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.

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.

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.

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.