Veil UI
Components

Social Button

A full-width sign-in button with a provider mark.

Installation

$ npx veil-ui@latest add social-button

Usage

import { SocialButton } from "@/components/ui/social-button";

<SocialButton icon={<GitHubMark />}>Continue with GitHub</SocialButton>;

Examples

Basic

Providers

Sizes

API reference

PropTypeDefaultDescription
iconReact.ReactNode—Provider mark rendered before the label.
variantButton variant"outline"Visual style inherited from Button.
...propsButtonProps—Size, disabled, onClick and native button attributes.

Wrap several buttons in SocialButtonGroup for consistent spacing.

Accessibility

  • The provider mark is decorative; the visible label is the accessible name.
  • Buttons are full width and at least 32px tall, with a visible focus ring.
  • Keep the provider name in the label instead of relying on the logo alone.

Vue and plain HTML

This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add social-button --framework vue or switch the framework in components.json.

<script setup lang="ts">
import { Button } from "@/components/ui/button";
import type { ButtonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";

const props = withDefaults(
  defineProps<{
    variant?: ButtonVariants["variant"];
    size?: ButtonVariants["size"];
    type?: "button" | "submit" | "reset";
    disabled?: boolean;
    class?: string;
  }>(),
  { variant: "outline", type: "button" },
);
</script>

<template>
  <Button
    data-slot="social-button"
    :variant="variant"
    :size="size"
    :type="type"
    :disabled="disabled"
    :class="cn('w-full gap-2', props.class)"
  >
    <span
      v-if="$slots.icon"
      data-slot="social-button-icon"
      class="inline-flex size-4 shrink-0 items-center justify-center [&>svg]:size-4"
    >
      <slot name="icon" />
    </span>
    <slot />
  </Button>
</template>

On this page