Skip to content

Social Login Buttons

Dark Tailwind CSS social login buttons for Google, Apple and GitHub with full-width and icon-only variants and a loading spinner state.

Also known as: oauth login buttons, sign in with google button, continue with google, social sign in buttons, third party login buttons

Tailwind CSS Social Buttons Responsive Dark #buttons #dark #login #oauth #social

Social Login Buttons live demo

Open in new tab

Tailwind CSS code (HTML, CSS, JS)

A dark set of "Continue with Google", "Continue with Apple" and "Continue with GitHub" buttons built with Tailwind CSS, for sign-up and sign-in pages that offer OAuth providers. It includes full-width pill buttons with labels and a compact row of round icon-only buttons, both with a built-in loading state.

How it works

The root is the .tsl-auth section, a full-height bg-zinc-950 page with a blurred amber glow and a rounded bg-zinc-900/80 card. Every provider button carries the .tsl-btn class and a data-tsl-provider attribute holding the provider name. The brand logos are inline SVG inside a .tsl-icon span; the wide buttons also have a data-tsl-label span with the visible text.

The script initializes each .tsl-auth on DOMContentLoaded and listens for click on every [data-tsl-provider] button. A click adds .tsl-loading and aria-busy="true" to that button, sets aria-disabled="true" on all buttons in the same root so a second provider cannot be started, changes the label to "Connecting to Google…" and writes the same text into the data-tsl-status message. In style.css, .tsl-loading hides the logo and draws a spinning ring with the tsl-spin keyframes. After the delay the state is restored and the status explains where the redirect would happen. Without JavaScript the buttons still render and can be turned into plain links.

Customization

  • data-tsl-delay on .tsl-auth: length of the simulated loading state in milliseconds (default 1500).
  • In script.js, replace the window.setTimeout block with window.location.href = '/auth/' + provider.toLowerCase(); to start your real OAuth flow.
  • rounded-full on the .tsl-btn buttons: switch to rounded-lg for squarer buttons that match a more formal form.
  • bg-white, bg-black and bg-zinc-800 on the three wide buttons: the brand-approved fills for Google, Apple and GitHub; keep Google white to follow its guidelines.
  • focus-visible:outline-amber-300: change amber to your brand color to restyle focus rings, the status text and the logo badge together with bg-amber-400.
  • Add another provider by copying a button, changing data-tsl-provider and swapping the SVG inside .tsl-icon.
  • Delete the "Compact" divider and the icon-only row if you only need the labeled buttons.

Use cases

  • Sign-up pages: offer Continue with Google, Apple and GitHub as full-width pill buttons
  • Login screens: a compact row of round icon-only buttons saves space
  • Auth modals: the loading spinner state shows a request is in progress
  • Developer tools: provider buttons on a dark layout speed up registration

Accessibility

The section is labelled by its heading through aria-labelledby. Icon-only buttons get an aria-label such as "Continue with Apple", and every logo SVG sits in an aria-hidden span. During loading the script uses aria-disabled instead of the disabled property, so keyboard focus stays on the clicked button, and aria-busy marks it as working. Progress and results are announced through the role="status" paragraph. All buttons and links show an amber focus-visible outline with good contrast on the dark background, the hover lift is disabled with motion-reduce:hover:translate-y-0, and the spinner slows down under prefers-reduced-motion.

Usage notes

Several .tsl-auth blocks can share a page; each one tracks its own loading state.

Social Login Buttons at a glance

Framework
Tailwind CSS
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Tailwind CSS
Layout
Responsive, works on mobile, dark design
Category
Social Buttons
License
Free for personal and commercial use

Questions about this template

Can I use the Social Login Buttons code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Tailwind CSS from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>

The Tailwind browser build is for prototyping. In production, compile Tailwind with its CLI or your bundler.

Social Login Buttons – free Tailwind CSS social button template
Social Login Buttons · free Tailwind CSS social button template

More Social Buttons

Sticky Social Share Sidebar – free Tailwind CSS social button template

Sticky Social Share Sidebar

Tailwind CSS article layout with a sticky vertical social share bar that turns into a fixed bottom bar on mobile, with copy link.

Social Share Buttons – free Pure CSS social button template

Social Share Buttons

Pure CSS social share card with brand-colored X, Facebook and LinkedIn buttons, a copy-link field with clipboard feedback and a native share fallback.