Social Button
Sign in with Google, Facebook, Apple, X, Figma or Dribbble on a button that shows the provider's logo, in its brand color or neutral.
Installation
pnpm dlx shadcn@4.18.0 add @siteplane/social-buttonComplete the one-time setup first. Registry JSON lists source files and dependencies.
Usage
import { SocialButton } from "@/siteplane/components/social-button";
<SocialButton social="google">Sign in with Google</SocialButton>;Providers and themes
social picks the provider: google, facebook, apple, x, figma or dribbble. theme sets how it shows:
brand, the default, fills the button with the provider’s color and a white logo: blue for Facebook, pink for Dribbble and black for Apple, X and Figma, in light and dark themes. The Figma logo keeps its colors on black, and Google’s button stays neutral with its colored logo.coloris the default button with the logo in its full colors. The Apple and X logos take the text color.grayis the default button with the logo in a muted gray, for a page where brand colors would compete, such as beside an email form.
In a column, as above, every button takes the full width of the column and centers its logo and label.
Icon only
Without children, the button shows the logo alone in a square of its size. In a grid, width="full" lets each of these buttons fill its cell and keeps its height. Screen readers hear “Sign in with” and the provider, such as “Sign in with Google”. Set aria-label when the button does something else, such as “Sign up with Google”.
Sizes
Omit size to use the control size from SiteplaneUIProvider (sm without a provider), so the button is as high as a Button or a field beside it. sm and md are 36 and 40 px high with a 14 px label and a 16 px logo, lg and xl 44 and 48 px with a 16 px label and a 20 px logo. An icon button is the square of its size.
Start the sign-in
SocialButton starts no sign-in by itself. Call your authentication library in onClick, or render a link to your sign-in route with render:
<SocialButton render={<a href="/auth/google" />} social="google">
Sign in with Google
</SocialButton>Keyboard focus, hover, press and disabled work as on Button. Disable the button while a sign-in is pending.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
Social | "google" | "facebook" | "apple" | "x" | "figma" | "dribbble" | required | The provider, which picks the logo and the brand color. |
Social | "brand" | "color" | "gray" | "brand" | brand fills the button with the provider’s color, color shows the full-color logo on the default button, gray shows a muted logo. |
Social | "sm" | "md" | "lg" | "xl" | provider / sm | sm and md are 36 and 40 px high with a 16 px logo, lg and xl 44 and 48 px with a 20 px logo. |
Social | ReactNode | unset | The label after the logo. Without one, the button shows the logo alone in a square. |
Social | string | “Sign in with” and the provider | The name of a button that shows the logo alone. |
SocialButtonProps extends the Button props except variant, size, shape,
profile, profileTone, multiline and loading, and accepts a ref.
disabled, width, className, onClick and render work as on Button. The
root carries data-social and data-social-theme. The types
SocialButtonProvider, SocialButtonTheme and SocialButtonSize are exported.
Usage notes
Provider names and logos are trademarks of their owners. Check each provider’s branding rules before you ship, for the wording of the label, such as Sign in with or Continue with, and for the look they allow on your background.
Offer the same providers on the sign-in and the sign-up page, in the same order.
Copy Button
Copy a value to the clipboard with an icon button or a labeled button that confirms with a check, a tooltip and an announcement.
Store Button
Link to your app on the App Store, Google Play, Galaxy Store or AppGallery with a badge that shows the store's mark and name, in black or as an outline.