Skip to content

Social Button

Get Ritla UI

Sign in with Google and Apple, with each provider's logo and colors. The provider name stays in Latin script inside Arabic labels.

Ritla scan of this preview: 41 of 41 checks3 breakpointsScanned

Open in Figma

Preview

Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.

PreviewCode
EnglishMirroredArabic
LTR →

Installation

  1. Add the component

    npx ritla add social-button

    Also works with shadcn: npx shadcn@latest add @ritla/social-button

  2. Dependencies it brings

    @base-ui/react

  3. Or copy by hand

    Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.

Usage

social-button.tsx
import { SocialButton } from "@/components/ui/social-button";<SocialButton provider="google" label="Sign in with Google" render={<a href="/auth/google" />} />

Examples

Color styles and icon only

brand uses the provider's colors (Apple in black), color is neutral. Google looks the same in both. iconOnly is a 44px square; label stays its name for screen readers. The last row is disabled.

EnglishMirroredArabic
LTR →

API reference

SocialButton

Any other Base UI Button prop passes through (onClick…).

PropTypeDefaultDescription
provider"google" | "apple"NoneFigma's Social.
labelstringNoneRequired. The visible text, or the button's name with iconOnly. Keep the provider name in Latin script.
theme"brand" | "color""brand"Figma's Theme.
iconOnlybooleanfalseFigma's Only icon.
disabledbooleanfalseFigma's State = Disabled: the disabled look in both themes, no hover or press.
renderReactElementNoneThe OAuth redirect link with the button look; it keeps its semantics.

Accessibility

Keyboard

Keys are written for left-to-right. In right-to-left the arrow keys swap: the one pointing toward the reading direction moves forward.

KeyAction
TabMoves focus to the button and shows the ring.
EnterSpaceStarts sign-in (Enter only for a link).

ARIA

  • The logo is decorative; the name is the text “Sign in with Google”, or label when icon-only.
  • The provider name is wrapped in <bdi dir="ltr"> automatically, so punctuation around it doesn't flip in Arabic.

Arabic and RTL notes

Mirrors

  • The logo sits at the inline start (the right in Arabic), the text after it.

Does not mirror

  • Logos never mirror, and the provider name is never translated or transliterated (“Google”, not “جوجل”).
Numerals
These buttons hold no numbers.
Arabic typography
body-16 Semibold, at a 44px height that fits Arabic.
Mixed-direction text
“تسجيل الدخول باستخدام Google”: the Latin name is isolated, so it stays at the end of the line as it's read.

Checks it passes

The Ritla checks this component satisfies by construction. Used as documented, it does not bring these defects onto your page.

  • R050Arabic text falling back past the declared font family (measured, declared, or a webfont that failed to load)
  • R051letter-spacing applied to Arabic text (breaks the connected script)
  • R042Clipped text: content wider than its box with overflow hidden and no ellipsis
  • R043Fixed-pixel-width container whose Arabic text exceeds the space