GitHub
Core
Glass
Brutal
Humanist

Social Button

Social buttons allow users to authenticate or interact using third-party platforms. They include specialized branding and icons that adapt to the current theme.

Social Button Playground

Social Button Playground
Preview
Code
Controls
Platform:
Google
Apple
Github
Size:
Small
Default
Large
Show Text:
Disabled:

Installation

You can add the social button component to your project manually:

1

Install the following dependencies:

npm install @react-aria/focus @react-aria/interactions
2

Copy and paste the following code into your project.

Loading source code...
3

Update the import paths to match your project setup.

Update the import aliases (e.g. @/components, @/utils) in the copied files to match your project's path configuration.

Basic Usage

Social buttons are typically used for OAuth flows. They automatically handle the platform's brand colors and icons:

import { SocialButton } from '@versaui/ui/components/Button';
function SocialLogin() {
  return (
    <div className="flex flex-col gap-4">
      <SocialButton platform="google" />
      <SocialButton platform="apple" />
      <SocialButton platform="github" />
    </div>
  );
}

Variants

Size

Three sizes are available — small, default, and large:

<SocialButton platform="google" size="small" />
<SocialButton platform="google" size="default" />
<SocialButton platform="google" size="large" />

Icon Only

Set showText={false} to display only the platform icon:

<SocialButton platform="google" showText={false} />

Custom Text

You can provide custom children to override the default "Continue with {Platform}" text:

<SocialButton platform="google">
  Sign in with Google
</SocialButton>

Supported Platforms

PlatformDescription
googleGoogle Sign-In
appleSign in with Apple
microsoftMicrosoft Account
facebookFacebook Login
xX (formerly Twitter)
githubGitHub OAuth
linkedinLinkedIn Login
discordDiscord OAuth
slackSlack Sign-In
figmaFigma OAuth

Accessibility

The Social Button component is fully accessible:

  • Keyboard navigation: Standard button behavior with focus indicators
  • Screen readers: Properly labeled buttons with accessible text
  • Semantic structure: Uses role="button" for correct interaction
  • Color contrast: Brand colors are adjusted to maintain contrast ratios

Social Button Props

PropTypeDefaultDescription
platform'google' | 'apple' | 'microsoft' | 'facebook' | 'x' | 'github' | 'linkedin' | 'discord' | 'slack' | 'figma''google'The social platform brand to display.
size'large' | 'default' | 'small''default'Size variant.
showTextbooleantrueWhether to show the "Continue with..." text.
disabledbooleanfalsePrevents interaction.
childrenReactNode'Continue with {Platform}'Custom button text.
classNamestring''Additional CSS classes.

On this page