Skip to content

Social Button

A sign-in button for the common providers and your own. A neutral outline, a brand fill that keeps to Google, Apple and Microsoft's own styles, or just the icon.

On this page
Used for
  • Sign-in and sign-up screens
  • Linking an account in settings
  • An SSO row with your own identity provider
  • A compact icon row under an email form

Examples

Installation

npx knowns-ui@latest add social-button
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

provider
SocialProvider | { id, label, icon? }
One of the 24 built-in names, or your own.
variant
outline | brand | icon
Defaultoutline
Neutral with a full-colour mark, the brand fill, or a square icon-only button.
size
xs | sm | md | lg
Defaultmd
The Button sizes.
verb
string
DefaultContinue with
The aria-label is the verb plus the name, such as Sign in with Google.
showVerb
boolean
Defaulttrue for brand
Show the verb in the label, not only the name. The official styles ask for it.
loading / disabled
boolean
Defaultfalse
As the Button. A spinner replaces the mark; clicks are ignored while loading.
Brand colours
-
Google: white or #131314 with a grey ring. Apple: black or white. Microsoft: white or #2F2F2F. The others use their own colour with black or white text.
Logos
-
The marks are Simple Icons paths (CC0). Trademarks belong to their owners; use them under each provider's sign-in guidelines. See LICENSES.md.

What it handles

  1. 01Ships marks for 24 providers and takes your own as { id, label, icon }.
  2. 02Three looks: a neutral outline with the full-colour mark, a brand fill, and a square icon-only button with a tooltip.
  3. 03Follows the official sign-in styles for Google, Apple and Microsoft in the brand look, light and dark, and never recolours their marks.
  4. 04Turns the near-black marks (Apple, GitHub, X, Notion, TikTok, Slack) white on a dark surface.
  5. 05Names each button for assistive tech as the verb plus the provider, such as Continue with GitHub, and hides the mark from it.
  6. 06Uses the Button sizes, loading state and disabled state as they are.

States

Hover
The surface shifts a little toward the text colour
120ms, ease-out
Press
The button scales to 0.97
120ms, ease-out
Loading
A spinner replaces the mark and the button ignores clicks
none
Focus
A ring around the button
colour only
Reduced motion
No press scale, no spinner sweep
0ms

Works with

When to use

When to use

  • Sign-in buttons for one-tap providers, in a row of full buttons or a row of icons.
  • Linking or unlinking an account in settings.

When not to use

  • A plain action that is not a sign-in: use Button.
  • A whole sign-in form with email, code and providers: use Auth.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Social Button to my app and wire it to my own data.
  • I need sign-in buttons for one-tap providers, in a row of full buttons or a row of icons. Set that up with the Knowns UI Social Button.
  • Which Social Button props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "social-button" }) and search_docs({ query: "social button" }).

Need help?

Stuck on Social Button, or found something off? We read every message.