Button Library · Interactive
Social Login
Sign in with a provider, full mark on white.
Check the provider's brand rules before you ship their mark.
States
Default
Hover
Active
Focus
Code
social-login.html
<button class="btn-social-login" type="button">
<svg class="btn-social-login__icon" viewBox="0 0 24 24" aria-hidden="true">
<path fill="#4285F4" d="M21.6 12.2c0-.7-.1-1.4-.2-2H12v3.9h5.4a4.6 4.6 0 0 1-2 3v2.5h3.2c1.9-1.7 3-4.3 3-7.4Z"></path>
<path fill="#34A853" d="M12 22c2.7 0 5-.9 6.6-2.4l-3.2-2.5c-.9.6-2 1-3.4 1-2.6 0-4.8-1.8-5.6-4.1H3.1v2.6A10 10 0 0 0 12 22Z"></path>
<path fill="#FBBC05" d="M6.4 14c-.2-.6-.3-1.3-.3-2s.1-1.4.3-2V7.4H3.1a10 10 0 0 0 0 9.2L6.4 14Z"></path>
<path fill="#EA4335" d="M12 6c1.5 0 2.8.5 3.8 1.5l2.9-2.9A10 10 0 0 0 3.1 7.4L6.4 10C7.2 7.7 9.4 6 12 6Z"></path>
</svg>
<span>Continue with Google</span>
</button>
social-login.css
.btn-social-login {
--btn-bg: #ffffff;
--btn-fg: #1f1f1f;
--btn-font: inherit;
--btn-size: 15px;
--btn-weight: 600;
--btn-px: 22px;
--btn-py: 11px;
--btn-w: auto;
--btn-h: auto;
--btn-bw: 1px;
--btn-line: #d6d6dc;
--btn-radius: 10px;
--btn-shadow: none;
--btn-speed: 180ms;
}
.btn-social-login {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.5em;
box-sizing: border-box;
width: var(--btn-w);
height: var(--btn-h);
padding: var(--btn-py) var(--btn-px);
font-family: var(--btn-font);
font-size: var(--btn-size);
font-weight: var(--btn-weight);
line-height: 1.2;
color: var(--btn-fg);
background: var(--btn-bg);
border: var(--btn-bw) solid var(--btn-line);
border-radius: var(--btn-radius);
box-shadow: var(--btn-shadow);
cursor: pointer;
text-decoration: none;
white-space: nowrap;
transition: all var(--btn-speed) ease;
}
.btn-social-login:focus-visible {
outline: 2px solid var(--btn-bg);
outline-offset: 2px;
}
.btn-social-login:disabled {
opacity: 0.5;
pointer-events: none;
}
.btn-social-login__icon {
width: 1.15em;
height: 1.15em;
flex-shrink: 0;
}
.btn-social-login:hover {
background: #f1f1f4;
}
@media (prefers-reduced-motion: reduce) {
.btn-social-login {
animation: none !important;
transition: none !important;
}
}
social-login.js
// No JavaScript needed: this one is CSS only.
social-login.tsx
import type React from "react";
import "./social-login.css"; // the CSS tab
export function BtnSocialLogin({ children = "Continue with Google", ...props }: React.ComponentProps<"button">) {
return (
<button className="btn-social-login" type="button" {...props}>
<svg className="btn-social-login__icon" viewBox="0 0 24 24" aria-hidden="true">
<path fill="#4285F4" d="M21.6 12.2c0-.7-.1-1.4-.2-2H12v3.9h5.4a4.6 4.6 0 0 1-2 3v2.5h3.2c1.9-1.7 3-4.3 3-7.4Z" />
<path fill="#34A853" d="M12 22c2.7 0 5-.9 6.6-2.4l-3.2-2.5c-.9.6-2 1-3.4 1-2.6 0-4.8-1.8-5.6-4.1H3.1v2.6A10 10 0 0 0 12 22Z" />
<path fill="#FBBC05" d="M6.4 14c-.2-.6-.3-1.3-.3-2s.1-1.4.3-2V7.4H3.1a10 10 0 0 0 0 9.2L6.4 14Z" />
<path fill="#EA4335" d="M12 6c1.5 0 2.8.5 3.8 1.5l2.9-2.9A10 10 0 0 0 3.1 7.4L6.4 10C7.2 7.7 9.4 6 12 6Z" />
</svg>
<span>{children}</span>
</button>
);
}
social-login.html
<button class="relative inline-flex items-center justify-center gap-[0.5em] [box-sizing:border-box] [padding:11px_22px] [font-family:inherit] text-[15px] font-[600] [line-height:1.2] text-[#1f1f1f] bg-[#ffffff] [border:1px_solid_#d6d6dc] rounded-[10px] [box-shadow:none] cursor-pointer no-underline whitespace-nowrap [transition:all_180ms_ease] focus-visible:[outline:2px_solid_#ffffff] focus-visible:[outline-offset:2px] disabled:[opacity:0.5] disabled:[pointer-events:none] hover:bg-[#f1f1f4] motion-reduce:[transition:none!important]" type="button">
<svg class="w-[1.15em] h-[1.15em] [flex-shrink:0]" viewBox="0 0 24 24" aria-hidden="true">
<path fill="#4285F4" d="M21.6 12.2c0-.7-.1-1.4-.2-2H12v3.9h5.4a4.6 4.6 0 0 1-2 3v2.5h3.2c1.9-1.7 3-4.3 3-7.4Z"></path>
<path fill="#34A853" d="M12 22c2.7 0 5-.9 6.6-2.4l-3.2-2.5c-.9.6-2 1-3.4 1-2.6 0-4.8-1.8-5.6-4.1H3.1v2.6A10 10 0 0 0 12 22Z"></path>
<path fill="#FBBC05" d="M6.4 14c-.2-.6-.3-1.3-.3-2s.1-1.4.3-2V7.4H3.1a10 10 0 0 0 0 9.2L6.4 14Z"></path>
<path fill="#EA4335" d="M12 6c1.5 0 2.8.5 3.8 1.5l2.9-2.9A10 10 0 0 0 3.1 7.4L6.4 10C7.2 7.7 9.4 6 12 6Z"></path>
</svg>
<span>Continue with Google</span>
</button>