Shadcn Social Button Components

OAuth sign in buttons for Google, Apple, GitHub, Microsoft, X, Facebook, Discord, LinkedIn, GitLab, Slack, Figma and Spotify, with official logos, outline and brand colored styles, icon only sizes and a loading state. Built on the shadcn/ui Button. Browse our collection of 12 Shadcn Social Button variants.

Basic

Sign in card

Welcome back
Sign in to continue to your workspace.
or

Brand colors

Icon only

Loading state

Sizes

Last used

Last used

Connected accounts

Google

olivia@gmail.com

GitHub

@olivia-martin

Slack

Not connected

Figma

Not connected

Side by side

Share buttons

Share this article

Join the community

Join the community
Ask questions, share what you build and get early access to new releases.

Rounded

Unlock premium components
Get full control of shadcn/ui components, blocks and instances, including future additions.

Explore Shadcn Blocks

Ready-made page sections built with the same components.

View all blocks

Shadcn Social Button Component

The Shadcn Social Button is a sign in button for OAuth providers such as Google, Apple, GitHub and Microsoft. It shows the official logo and a clear "Continue with" label, so users can create an account or sign in with one click instead of filling in a form.

This collection covers the real places these buttons appear: a complete sign in card with an email fallback, brand colored buttons, icon only rows, a loading state during the redirect, a Last used badge, a connected accounts settings page, share buttons for articles and a community invite card. It supports twelve providers and is built on the Button component from shadcn/ui, with React and Tailwind CSS.

What is the Shadcn Social Button Component?

SocialButton is a regular shadcn Button with a provider prop. The provider decides the logo and the default label, for example "Continue with GitHub". It accepts every Button prop, including size, asChild and onClick, so it plugs into any auth library such as Auth.js, Better Auth, Clerk or Supabase Auth.

By default the button uses the neutral outline style of your theme, which fits any design. The brand variant switches to each provider's own colors, such as Facebook blue or Discord blurple, and icon sizes render only the logo with an accessible label. SocialIcon exports the logos on their own for settings pages and lists.

Anatomy of the Shadcn Social Button

PartDescription
SocialButtonThe button. Props: provider, variant (Button variants plus brand), size, loading and optional children to replace the label.
SocialIconThe provider logo as an SVG. Multicolor logos keep their official colors and single color logos use currentColor.
socialProvidersA map from provider key to display name, useful for tooltips and labels.

12 Shadcn Social Button Variants

Each social button variant listed here is previewed live at the top of this page, together with its source code and install command.

  • Basic: A single Continue with Google button.
  • Sign in card: Google, Apple and GitHub buttons above an or divider and an email field.
  • Brand colors: Eight providers in their official brand colors, adapted for dark mode where the brand allows it.
  • Icon only: A row of logo buttons with tooltips for compact layouts.
  • Loading state: The clicked provider shows a spinner and Redirecting while the other buttons are disabled.
  • Sizes: Small, default and large buttons.
  • Last used: A badge on the provider the user signed in with last time.
  • Connected accounts: A settings list where users connect and disconnect Google, GitHub, Slack and Figma.
  • Side by side: Google and Apple in two columns with short labels.
  • Share buttons: Post on X, share on LinkedIn and Facebook, and copy link.
  • Join the community: A card with Discord and Slack invite buttons.
  • Rounded: Large pill shaped buttons, common in mobile first apps.

How to Install the Shadcn Social Button Component

Set up shadcn/ui in your project if you have not already, then add the Shadcn UI Kit registry to your components.json once:

{
  "registries": {
    "@shadcnuikit": "https://shadcnuikit.com/r/{name}.json"
  }
}

Then install a social button variant by its name:

npx shadcn@latest add @shadcnuikit/socialbutton1

The same command works with pnpm dlx, yarn dlx and bunx --bun. Each variant has a copy button for every package manager, and the code is added to your project as plain React and Tailwind CSS that you can edit freely.

How to Use the Shadcn Social Button Component

Render one SocialButton per provider and start the OAuth flow in onClick. Set loading on the clicked button while the redirect starts.

"use client"

import { useState } from "react"

import { SocialButton, type SocialProvider } from "@/components/ui/social-button"
import { signIn } from "@/lib/auth-client"

export function OAuthButtons() {
  const [pending, setPending] = useState<SocialProvider | null>(null)

  return (
    <div className="grid gap-2">
      {(["google", "github"] as const).map((provider) => (
        <SocialButton
          key={provider}
          provider={provider}
          loading={pending === provider}
          disabled={pending !== null}
          onClick={() => {
            setPending(provider)
            signIn.social({ provider })
          }}
        />
      ))}
    </div>
  )
}

Why Use the Shadcn Social Button Component

  • Official logos included: Twelve provider logos ship as inline SVG, so there is no icon package to install and no image request.
  • Neutral or brand styles: Use the outline style that matches your theme, or the brand variant that follows each provider's colors.
  • Built on Button: Sizes, focus rings, disabled states and asChild all work exactly like the Button you already use.
  • Loading built in: The loading prop swaps the logo for a spinner and disables the button to prevent double clicks.
  • Auth library agnostic: It is only the UI, so it works with Auth.js, Better Auth, Clerk, Supabase, Firebase or your own OAuth routes.

Common Social Button Use Cases

  • Sign in and sign up: The main OAuth options above an email form.
  • Checkout: Express account creation before payment.
  • Account settings: Connect and disconnect linked accounts.
  • Blog and docs: Share buttons under an article.
  • Community: Invite users to Discord or Slack from onboarding.
  • Integrations: Authorize tools such as GitHub, Slack or Figma.

Customizing the Shadcn Social Button

Any Button variant works, so variant="secondary" or variant="ghost" are available alongside brand. Pass children to shorten the label, such as "Google" in a two column layout, and add classes like w-full or rounded-full for layout and shape.

To add a provider, add an entry with its name, brand classes and SVG logo to the providers map in components/ui/social-button.tsx. The type updates automatically.

<SocialButton provider="apple" variant="brand" size="lg" className="w-full rounded-full" />
<SocialButton provider="google">Google</SocialButton>
<SocialButton provider="github" size="icon" />

Social Button Accessibility and Keyboard Support

Each button is a native button with visible text, and the logos are marked aria-hidden. Icon only sizes get an aria-label such as "Continue with GitHub"automatically, so screen reader users still hear which provider it is.

While loading is set, the button is disabled and has aria-busy. Keep labels explicit and in the same order on every auth screen, so users can find their provider quickly.

KeyAction
TabMoves focus between the provider buttons.
Enter / SpaceStarts sign in with the focused provider.

Social Button Best Practices

  • Show two or three providers your users actually use rather than every option.
  • Put the most common provider first and keep the order the same on sign in and sign up.
  • Keep an email option for users who do not want to link a social account.
  • Use Continue with as the label, since it works for both new and returning users.
  • Follow brand guidelines when you use the brand variant: do not recolor or stretch the logos.
  • Show errors from the provider in an Alert above the buttons instead of a toast that disappears.

Shadcn Social Button for AI Agents

Social Button gives an agent ready OAuth buttons for twelve providers, so it can build a sign in page, an account linking screen or share buttons without searching for logos. Claude Code can wire each button to your auth library, show a loading state during the redirect, mark the last used provider and switch between the neutral outline and the brand colored style.

Install it with an AI agent

Claude Code, Cursor, Codex and other agents can install these with the shadcn CLI, for example npx shadcn@latest add @shadcnuikit/socialbutton1. With the Shadcn UI Kit MCP server, your agent can search every variant by name and add the right one for you. To give it full context, share /components/social-button.md, the Markdown version of this page with every variant and install command.

Example prompts

  • “Add Continue with Google and GitHub SocialButtons to our sign in page above the email form, wired to Better Auth signIn.social.”
  • “Build a Connected accounts section in settings that lists Google, GitHub and Slack with Connect and Disconnect buttons.”
  • “Show a Last used badge on the provider stored in the last-login cookie on the sign in page.”

Customize it with AI

Provider logos and brand colors live in one providers map, so the agent should add new providers there instead of inlining SVGs in pages. Ask it to keep the Continue with label, pass loading to the clicked button and disable the others while the redirect starts, and use icon sizes only together with a Tooltip.

Components Related to Social Button

Shadcn Social Button FAQ

Install the Social Button component and render <SocialButton provider="google" />. It shows the official Google logo and the label Continue with Google, and you start your OAuth flow in onClick.

Google, Apple, GitHub, Microsoft, X, Facebook, Discord, LinkedIn, GitLab, Slack, Figma and Spotify. You can add more by extending the providers map in the component file.

Yes. It is only the button UI, so you call your auth library in onClick, for example signIn('google') with Auth.js or supabase.auth.signInWithOAuth with Supabase.

Set the loading prop on the clicked button. It replaces the logo with a spinner, disables the button and sets aria-busy. Disable the other provider buttons at the same time.

Yes. Set variant="brand" to use each provider's official colors, such as Facebook blue or Discord blurple. The default outline variant uses your theme instead.

Use size="icon" or another icon size. The component adds an aria-label such as Continue with GitHub automatically, and you can wrap it in a Tooltip to show the provider name on hover.

Yes. Claude Code, Cursor, Copilot and other assistants can add a social button variant with the shadcn CLI or the shadcn MCP server, for example npx shadcn@latest add @shadcnuikit/socialbutton1. With a Pro plan, the Shadcn UI Kit MCP server can also build complete sections and pages around it.

Open /components/social-button.md to get this page as Markdown, with every social button variant, its description and install command. Paste the link or the text into your AI tool so it uses the real component code instead of guessing.

Looking for something else? Browse all shadcn/ui components or ready-made UI blocks built with them.

Shadcn Social Button component preview