Social Button
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
Preview
Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.
Installation
Add the component
npx ritla add social-buttonAlso works with shadcn:
npx shadcn@latest add @ritla/social-buttonDependencies it brings
@base-ui/reactOr 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
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.
API reference
SocialButton
Any other Base UI Button prop passes through (onClick…).
| Prop | Type | Default | Description |
|---|---|---|---|
provider | "google" | "apple" | None | Figma's Social. |
label | string | None | Required. The visible text, or the button's name with iconOnly. Keep the provider name in Latin script. |
theme | "brand" | "color" | "brand" | Figma's Theme. |
iconOnly | boolean | false | Figma's Only icon. |
disabled | boolean | false | Figma's State = Disabled: the disabled look in both themes, no hover or press. |
render | ReactElement | None | The 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.
| Key | Action |
|---|---|
| Tab | Moves focus to the button and shows the ring. |
| EnterSpace | Starts sign-in (Enter only for a link). |
ARIA
- The logo is decorative; the name is the text “Sign in with Google”, or
labelwhen 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-16Semibold, 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.
- Arabic text falling back past the declared font family (measured, declared, or a webfont that failed to load)
- letter-spacing applied to Arabic text (breaks the connected script)
- Clipped text: content wider than its box with overflow hidden and no ellipsis
- Fixed-pixel-width container whose Arabic text exceeds the space